VirtualBox

Changeset 21878 in vbox


Ignore:
Timestamp:
Jul 30, 2009 12:42:08 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50525
Message:

Main: coding style: have Main obey the standard VirtualBox coding style rules (no functional changes)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImpl.cpp

    r21823 r21878  
    349349{
    350350    /* Enclose the state transition Ready->InUninit->NotReady */
    351     AutoUninitSpan autoUninitSpan (this);
     351    AutoUninitSpan autoUninitSpan(this);
    352352    if (autoUninitSpan.uninitDone())
    353353        return;
  • trunk/src/VBox/Main/AudioAdapterImpl.cpp

    r20501 r21878  
    5353HRESULT AudioAdapter::init (Machine *aParent)
    5454{
    55     LogFlowThisFunc (("aParent=%p\n", aParent));
     55    LogFlowThisFunc(("aParent=%p\n", aParent));
    5656
    5757    ComAssertRet (aParent, E_INVALIDARG);
    5858
    5959    /* Enclose the state transition NotReady->InInit->Ready */
    60     AutoInitSpan autoInitSpan (this);
    61     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     60    AutoInitSpan autoInitSpan(this);
     61    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6262
    6363    /* Get the default audio driver out of the system properties */
     
    7272    if (FAILED(rc)) return rc;
    7373
    74     unconst (mParent) = aParent;
     74    unconst(mParent) = aParent;
    7575    /* mPeer is left null */
    7676
     
    9696HRESULT AudioAdapter::init (Machine *aParent, AudioAdapter *aThat)
    9797{
    98     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     98    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    9999
    100100    ComAssertRet (aParent && aThat, E_INVALIDARG);
    101101
    102102    /* Enclose the state transition NotReady->InInit->Ready */
    103     AutoInitSpan autoInitSpan (this);
    104     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    105 
    106     unconst (mParent) = aParent;
    107     unconst (mPeer) = aThat;
     103    AutoInitSpan autoInitSpan(this);
     104    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     105
     106    unconst(mParent) = aParent;
     107    unconst(mPeer) = aThat;
    108108
    109109    AutoCaller thatCaller (aThat);
    110     AssertComRCReturnRC (thatCaller.rc());
     110    AssertComRCReturnRC(thatCaller.rc());
    111111
    112112    AutoReadLock thatLock (aThat);
     
    128128HRESULT AudioAdapter::initCopy (Machine *aParent, AudioAdapter *aThat)
    129129{
    130     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     130    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    131131
    132132    ComAssertRet (aParent && aThat, E_INVALIDARG);
    133133
    134134    /* Enclose the state transition NotReady->InInit->Ready */
    135     AutoInitSpan autoInitSpan (this);
    136     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    137 
    138     unconst (mParent) = aParent;
     135    AutoInitSpan autoInitSpan(this);
     136    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     137
     138    unconst(mParent) = aParent;
    139139    /* mPeer is left null */
    140140
    141141    AutoCaller thatCaller (aThat);
    142     AssertComRCReturnRC (thatCaller.rc());
     142    AssertComRCReturnRC(thatCaller.rc());
    143143
    144144    AutoReadLock thatLock (aThat);
     
    157157void AudioAdapter::uninit()
    158158{
    159     LogFlowThisFunc (("\n"));
     159    LogFlowThisFunc(("\n"));
    160160
    161161    /* Enclose the state transition Ready->InUninit->NotReady */
    162     AutoUninitSpan autoUninitSpan (this);
     162    AutoUninitSpan autoUninitSpan(this);
    163163    if (autoUninitSpan.uninitDone())
    164164        return;
     
    166166    mData.free();
    167167
    168     unconst (mPeer).setNull();
    169     unconst (mParent).setNull();
     168    unconst(mPeer).setNull();
     169    unconst(mParent).setNull();
    170170}
    171171
     
    177177    CheckComArgOutPointerValid(aEnabled);
    178178
    179     AutoCaller autoCaller (this);
    180     CheckComRCReturnRC (autoCaller.rc());
    181 
    182     AutoReadLock alock (this);
     179    AutoCaller autoCaller(this);
     180    CheckComRCReturnRC(autoCaller.rc());
     181
     182    AutoReadLock alock(this);
    183183
    184184    *aEnabled = mData->mEnabled;
     
    189189STDMETHODIMP AudioAdapter::COMSETTER(Enabled)(BOOL aEnabled)
    190190{
    191     AutoCaller autoCaller (this);
    192     CheckComRCReturnRC (autoCaller.rc());
     191    AutoCaller autoCaller(this);
     192    CheckComRCReturnRC(autoCaller.rc());
    193193
    194194    /* the machine needs to be mutable */
    195195    Machine::AutoMutableStateDependency adep (mParent);
    196     CheckComRCReturnRC (adep.rc());
    197 
    198     AutoWriteLock alock (this);
     196    CheckComRCReturnRC(adep.rc());
     197
     198    AutoWriteLock alock(this);
    199199
    200200    if (mData->mEnabled != aEnabled)
     
    211211    CheckComArgOutPointerValid(aAudioDriver);
    212212
    213     AutoCaller autoCaller (this);
    214     CheckComRCReturnRC (autoCaller.rc());
    215 
    216     AutoReadLock alock (this);
     213    AutoCaller autoCaller(this);
     214    CheckComRCReturnRC(autoCaller.rc());
     215
     216    AutoReadLock alock(this);
    217217
    218218    *aAudioDriver = mData->mAudioDriver;
     
    223223STDMETHODIMP AudioAdapter::COMSETTER(AudioDriver)(AudioDriverType_T aAudioDriver)
    224224{
    225     AutoCaller autoCaller (this);
    226     CheckComRCReturnRC (autoCaller.rc());
     225    AutoCaller autoCaller(this);
     226    CheckComRCReturnRC(autoCaller.rc());
    227227
    228228    /* the machine needs to be mutable */
    229229    Machine::AutoMutableStateDependency adep (mParent);
    230     CheckComRCReturnRC (adep.rc());
    231 
    232     AutoWriteLock alock (this);
     230    CheckComRCReturnRC(adep.rc());
     231
     232    AutoWriteLock alock(this);
    233233
    234234    HRESULT rc = S_OK;
     
    290290    CheckComArgOutPointerValid(aAudioController);
    291291
    292     AutoCaller autoCaller (this);
    293     CheckComRCReturnRC (autoCaller.rc());
    294 
    295     AutoReadLock alock (this);
     292    AutoCaller autoCaller(this);
     293    CheckComRCReturnRC(autoCaller.rc());
     294
     295    AutoReadLock alock(this);
    296296
    297297    *aAudioController = mData->mAudioController;
     
    302302STDMETHODIMP AudioAdapter::COMSETTER(AudioController)(AudioControllerType_T aAudioController)
    303303{
    304     AutoCaller autoCaller (this);
    305     CheckComRCReturnRC (autoCaller.rc());
     304    AutoCaller autoCaller(this);
     305    CheckComRCReturnRC(autoCaller.rc());
    306306
    307307    /* the machine needs to be mutable */
    308308    Machine::AutoMutableStateDependency adep (mParent);
    309     CheckComRCReturnRC (adep.rc());
    310 
    311     AutoWriteLock alock (this);
     309    CheckComRCReturnRC(adep.rc());
     310
     311    AutoWriteLock alock(this);
    312312
    313313    HRESULT rc = S_OK;
     
    365365    using namespace settings;
    366366
    367     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    368 
    369     AutoCaller autoCaller (this);
    370     AssertComRCReturnRC (autoCaller.rc());
    371 
    372     AutoWriteLock alock (this);
     367    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     368
     369    AutoCaller autoCaller(this);
     370    AssertComRCReturnRC(autoCaller.rc());
     371
     372    AutoWriteLock alock(this);
    373373
    374374    /* Note: we assume that the default values for attributes of optional
     
    460460    using namespace settings;
    461461
    462     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    463 
    464     AutoCaller autoCaller (this);
    465     AssertComRCReturnRC (autoCaller.rc());
    466 
    467     AutoReadLock alock (this);
     462    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     463
     464    AutoCaller autoCaller(this);
     465    AssertComRCReturnRC(autoCaller.rc());
     466
     467    AutoReadLock alock(this);
    468468
    469469    Key node = aMachineNode.createKey ("AudioAdapter");
     
    569569{
    570570    /* sanity */
    571     AutoCaller autoCaller (this);
     571    AutoCaller autoCaller(this);
    572572    AssertComRCReturn (autoCaller.rc(), false);
    573573
    574     AutoWriteLock alock (this);
     574    AutoWriteLock alock(this);
    575575
    576576    bool changed = false;
     
    594594{
    595595    /* sanity */
    596     AutoCaller autoCaller (this);
     596    AutoCaller autoCaller(this);
    597597    AssertComRCReturnVoid (autoCaller.rc());
    598598
     
    625625
    626626    /* sanity */
    627     AutoCaller autoCaller (this);
     627    AutoCaller autoCaller(this);
    628628    AssertComRCReturnVoid (autoCaller.rc());
    629629
  • trunk/src/VBox/Main/BIOSSettingsImpl.cpp

    r17669 r21878  
    5252{
    5353    LogFlowThisFuncEnter();
    54     LogFlowThisFunc (("aParent: %p\n", aParent));
     54    LogFlowThisFunc(("aParent: %p\n", aParent));
    5555
    5656    ComAssertRet (aParent, E_INVALIDARG);
    5757
    5858    /* Enclose the state transition NotReady->InInit->Ready */
    59     AutoInitSpan autoInitSpan (this);
    60     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     59    AutoInitSpan autoInitSpan(this);
     60    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6161
    6262    /* share the parent weakly */
    63     unconst (mParent) = aParent;
     63    unconst(mParent) = aParent;
    6464
    6565    mData.allocate();
     
    8282{
    8383    LogFlowThisFuncEnter();
    84     LogFlowThisFunc (("aParent: %p, that: %p\n", aParent, that));
     84    LogFlowThisFunc(("aParent: %p, that: %p\n", aParent, that));
    8585
    8686    ComAssertRet (aParent && that, E_INVALIDARG);
    8787
    8888    /* Enclose the state transition NotReady->InInit->Ready */
    89     AutoInitSpan autoInitSpan (this);
    90     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     89    AutoInitSpan autoInitSpan(this);
     90    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    9191
    9292    mParent = aParent;
     
    110110{
    111111    LogFlowThisFuncEnter();
    112     LogFlowThisFunc (("aParent: %p, that: %p\n", aParent, that));
     112    LogFlowThisFunc(("aParent: %p, that: %p\n", aParent, that));
    113113
    114114    ComAssertRet (aParent && that, E_INVALIDARG);
    115115
    116116    /* Enclose the state transition NotReady->InInit->Ready */
    117     AutoInitSpan autoInitSpan (this);
    118     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     117    AutoInitSpan autoInitSpan(this);
     118    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    119119
    120120    mParent = aParent;
     
    139139
    140140    /* Enclose the state transition Ready->InUninit->NotReady */
    141     AutoUninitSpan autoUninitSpan (this);
     141    AutoUninitSpan autoUninitSpan(this);
    142142    if (autoUninitSpan.uninitDone())
    143143        return;
     
    159159        return E_POINTER;
    160160
    161     AutoCaller autoCaller (this);
    162     CheckComRCReturnRC (autoCaller.rc());
    163 
    164     AutoReadLock alock (this);
     161    AutoCaller autoCaller(this);
     162    CheckComRCReturnRC(autoCaller.rc());
     163
     164    AutoReadLock alock(this);
    165165
    166166    *enabled = mData->mLogoFadeIn;
     
    171171STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeIn)(BOOL enable)
    172172{
    173     AutoCaller autoCaller (this);
    174     CheckComRCReturnRC (autoCaller.rc());
    175 
    176     /* the machine needs to be mutable */
    177     Machine::AutoMutableStateDependency adep (mParent);
    178     CheckComRCReturnRC (adep.rc());
    179 
    180     AutoWriteLock alock (this);
     173    AutoCaller autoCaller(this);
     174    CheckComRCReturnRC(autoCaller.rc());
     175
     176    /* the machine needs to be mutable */
     177    Machine::AutoMutableStateDependency adep (mParent);
     178    CheckComRCReturnRC(adep.rc());
     179
     180    AutoWriteLock alock(this);
    181181
    182182    mData.backup();
     
    191191        return E_POINTER;
    192192
    193     AutoCaller autoCaller (this);
    194     CheckComRCReturnRC (autoCaller.rc());
    195 
    196     AutoReadLock alock (this);
     193    AutoCaller autoCaller(this);
     194    CheckComRCReturnRC(autoCaller.rc());
     195
     196    AutoReadLock alock(this);
    197197
    198198    *enabled = mData->mLogoFadeOut;
     
    203203STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeOut)(BOOL enable)
    204204{
    205     AutoCaller autoCaller (this);
    206     CheckComRCReturnRC (autoCaller.rc());
    207 
    208     /* the machine needs to be mutable */
    209     Machine::AutoMutableStateDependency adep (mParent);
    210     CheckComRCReturnRC (adep.rc());
    211 
    212     AutoWriteLock alock (this);
     205    AutoCaller autoCaller(this);
     206    CheckComRCReturnRC(autoCaller.rc());
     207
     208    /* the machine needs to be mutable */
     209    Machine::AutoMutableStateDependency adep (mParent);
     210    CheckComRCReturnRC(adep.rc());
     211
     212    AutoWriteLock alock(this);
    213213
    214214    mData.backup();
     
    223223        return E_POINTER;
    224224
    225     AutoCaller autoCaller (this);
    226     CheckComRCReturnRC (autoCaller.rc());
    227 
    228     AutoReadLock alock (this);
     225    AutoCaller autoCaller(this);
     226    CheckComRCReturnRC(autoCaller.rc());
     227
     228    AutoReadLock alock(this);
    229229
    230230    *displayTime = mData->mLogoDisplayTime;
     
    235235STDMETHODIMP BIOSSettings::COMSETTER(LogoDisplayTime)(ULONG displayTime)
    236236{
    237     AutoCaller autoCaller (this);
    238     CheckComRCReturnRC (autoCaller.rc());
    239 
    240     /* the machine needs to be mutable */
    241     Machine::AutoMutableStateDependency adep (mParent);
    242     CheckComRCReturnRC (adep.rc());
    243 
    244     AutoWriteLock alock (this);
     237    AutoCaller autoCaller(this);
     238    CheckComRCReturnRC(autoCaller.rc());
     239
     240    /* the machine needs to be mutable */
     241    Machine::AutoMutableStateDependency adep (mParent);
     242    CheckComRCReturnRC(adep.rc());
     243
     244    AutoWriteLock alock(this);
    245245
    246246    mData.backup();
     
    255255        return E_POINTER;
    256256
    257     AutoCaller autoCaller (this);
    258     CheckComRCReturnRC (autoCaller.rc());
    259 
    260     AutoReadLock alock (this);
     257    AutoCaller autoCaller(this);
     258    CheckComRCReturnRC(autoCaller.rc());
     259
     260    AutoReadLock alock(this);
    261261
    262262    mData->mLogoImagePath.cloneTo(imagePath);
     
    270270        return E_INVALIDARG;
    271271
    272     AutoCaller autoCaller (this);
    273     CheckComRCReturnRC (autoCaller.rc());
    274 
    275     /* the machine needs to be mutable */
    276     Machine::AutoMutableStateDependency adep (mParent);
    277     CheckComRCReturnRC (adep.rc());
    278 
    279     AutoWriteLock alock (this);
     272    AutoCaller autoCaller(this);
     273    CheckComRCReturnRC(autoCaller.rc());
     274
     275    /* the machine needs to be mutable */
     276    Machine::AutoMutableStateDependency adep (mParent);
     277    CheckComRCReturnRC(adep.rc());
     278
     279    AutoWriteLock alock(this);
    280280
    281281    mData.backup();
     
    290290        return E_POINTER;
    291291
    292     AutoCaller autoCaller (this);
    293     CheckComRCReturnRC (autoCaller.rc());
    294 
    295     AutoReadLock alock (this);
     292    AutoCaller autoCaller(this);
     293    CheckComRCReturnRC(autoCaller.rc());
     294
     295    AutoReadLock alock(this);
    296296
    297297    *bootMenuMode = mData->mBootMenuMode;
     
    301301STDMETHODIMP BIOSSettings::COMSETTER(BootMenuMode)(BIOSBootMenuMode_T bootMenuMode)
    302302{
    303     AutoCaller autoCaller (this);
    304     CheckComRCReturnRC (autoCaller.rc());
    305 
    306     /* the machine needs to be mutable */
    307     Machine::AutoMutableStateDependency adep (mParent);
    308     CheckComRCReturnRC (adep.rc());
    309 
    310     AutoWriteLock alock (this);
     303    AutoCaller autoCaller(this);
     304    CheckComRCReturnRC(autoCaller.rc());
     305
     306    /* the machine needs to be mutable */
     307    Machine::AutoMutableStateDependency adep (mParent);
     308    CheckComRCReturnRC(adep.rc());
     309
     310    AutoWriteLock alock(this);
    311311
    312312    mData.backup();
     
    321321        return E_POINTER;
    322322
    323     AutoCaller autoCaller (this);
    324     CheckComRCReturnRC (autoCaller.rc());
    325 
    326     AutoReadLock alock (this);
     323    AutoCaller autoCaller(this);
     324    CheckComRCReturnRC(autoCaller.rc());
     325
     326    AutoReadLock alock(this);
    327327
    328328    *enabled = mData->mACPIEnabled;
     
    333333STDMETHODIMP BIOSSettings::COMSETTER(ACPIEnabled)(BOOL enable)
    334334{
    335     AutoCaller autoCaller (this);
    336     CheckComRCReturnRC (autoCaller.rc());
    337 
    338     /* the machine needs to be mutable */
    339     Machine::AutoMutableStateDependency adep (mParent);
    340     CheckComRCReturnRC (adep.rc());
    341 
    342     AutoWriteLock alock (this);
     335    AutoCaller autoCaller(this);
     336    CheckComRCReturnRC(autoCaller.rc());
     337
     338    /* the machine needs to be mutable */
     339    Machine::AutoMutableStateDependency adep (mParent);
     340    CheckComRCReturnRC(adep.rc());
     341
     342    AutoWriteLock alock(this);
    343343
    344344    mData.backup();
     
    353353        return E_POINTER;
    354354
    355     AutoCaller autoCaller (this);
    356     CheckComRCReturnRC (autoCaller.rc());
    357 
    358     AutoReadLock alock (this);
     355    AutoCaller autoCaller(this);
     356    CheckComRCReturnRC(autoCaller.rc());
     357
     358    AutoReadLock alock(this);
    359359
    360360    *enabled = mData->mIOAPICEnabled;
     
    365365STDMETHODIMP BIOSSettings::COMSETTER(IOAPICEnabled)(BOOL enable)
    366366{
    367     AutoCaller autoCaller (this);
    368     CheckComRCReturnRC (autoCaller.rc());
    369 
    370     /* the machine needs to be mutable */
    371     Machine::AutoMutableStateDependency adep (mParent);
    372     CheckComRCReturnRC (adep.rc());
    373 
    374     AutoWriteLock alock (this);
     367    AutoCaller autoCaller(this);
     368    CheckComRCReturnRC(autoCaller.rc());
     369
     370    /* the machine needs to be mutable */
     371    Machine::AutoMutableStateDependency adep (mParent);
     372    CheckComRCReturnRC(adep.rc());
     373
     374    AutoWriteLock alock(this);
    375375
    376376    mData.backup();
     
    385385        return E_POINTER;
    386386
    387     AutoCaller autoCaller (this);
    388     CheckComRCReturnRC (autoCaller.rc());
    389 
    390     AutoReadLock alock (this);
     387    AutoCaller autoCaller(this);
     388    CheckComRCReturnRC(autoCaller.rc());
     389
     390    AutoReadLock alock(this);
    391391
    392392    *enabled = mData->mPXEDebugEnabled;
     
    397397STDMETHODIMP BIOSSettings::COMSETTER(PXEDebugEnabled)(BOOL enable)
    398398{
    399     AutoCaller autoCaller (this);
    400     CheckComRCReturnRC (autoCaller.rc());
    401 
    402     /* the machine needs to be mutable */
    403     Machine::AutoMutableStateDependency adep (mParent);
    404     CheckComRCReturnRC (adep.rc());
    405 
    406     AutoWriteLock alock (this);
     399    AutoCaller autoCaller(this);
     400    CheckComRCReturnRC(autoCaller.rc());
     401
     402    /* the machine needs to be mutable */
     403    Machine::AutoMutableStateDependency adep (mParent);
     404    CheckComRCReturnRC(adep.rc());
     405
     406    AutoWriteLock alock(this);
    407407
    408408    mData.backup();
     
    417417        return E_POINTER;
    418418
    419     AutoCaller autoCaller (this);
    420     CheckComRCReturnRC (autoCaller.rc());
    421 
    422     AutoReadLock alock (this);
     419    AutoCaller autoCaller(this);
     420    CheckComRCReturnRC(autoCaller.rc());
     421
     422    AutoReadLock alock(this);
    423423
    424424    *offset = mData->mTimeOffset;
     
    429429STDMETHODIMP BIOSSettings::COMSETTER(TimeOffset)(LONG64 offset)
    430430{
    431     AutoCaller autoCaller (this);
    432     CheckComRCReturnRC (autoCaller.rc());
    433 
    434     /* the machine needs to be mutable */
    435     Machine::AutoMutableStateDependency adep (mParent);
    436     CheckComRCReturnRC (adep.rc());
    437 
    438     AutoWriteLock alock (this);
     431    AutoCaller autoCaller(this);
     432    CheckComRCReturnRC(autoCaller.rc());
     433
     434    /* the machine needs to be mutable */
     435    Machine::AutoMutableStateDependency adep (mParent);
     436    CheckComRCReturnRC(adep.rc());
     437
     438    AutoWriteLock alock(this);
    439439
    440440    mData.backup();
     
    463463    using namespace settings;
    464464
    465     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    466 
    467     AutoCaller autoCaller (this);
    468     AssertComRCReturnRC (autoCaller.rc());
    469 
    470     AutoWriteLock alock (this);
     465    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     466
     467    AutoCaller autoCaller(this);
     468    AssertComRCReturnRC(autoCaller.rc());
     469
     470    AutoWriteLock alock(this);
    471471
    472472    /* Note: we assume that the default values for attributes of optional
     
    558558    using namespace settings;
    559559
    560     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    561 
    562     AutoCaller autoCaller (this);
    563     AssertComRCReturnRC (autoCaller.rc());
    564 
    565     AutoReadLock alock (this);
     560    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     561
     562    AutoCaller autoCaller(this);
     563    AssertComRCReturnRC(autoCaller.rc());
     564
     565    AutoReadLock alock(this);
    566566
    567567    Key biosNode = aMachineNode.createKey ("BIOS");
     
    629629{
    630630    /* sanity */
    631     AutoCaller autoCaller (this);
     631    AutoCaller autoCaller(this);
    632632    AssertComRCReturnVoid (autoCaller.rc());
    633633
     
    657657
    658658    /* sanity */
    659     AutoCaller autoCaller (this);
     659    AutoCaller autoCaller(this);
    660660    AssertComRCReturnVoid (autoCaller.rc());
    661661
     
    677677
    678678    /* sanity */
    679     AutoCaller autoCaller (this);
     679    AutoCaller autoCaller(this);
    680680    AssertComRCReturnVoid (autoCaller.rc());
    681681
    682     AutoWriteLock alock (this);
     682    AutoWriteLock alock(this);
    683683
    684684    /* Initialize default BIOS settings here */
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r21877 r21878  
    125125        AssertReturnVoid (aConsole);
    126126        mRC = aConsole->addCaller();
    127         if (SUCCEEDED (mRC))
     127        if (SUCCEEDED(mRC))
    128128        {
    129129            mCallerAdded = true;
     
    131131            {
    132132                mRC = aConsole->addVMCaller();
    133                 if (SUCCEEDED (mRC))
     133                if (SUCCEEDED(mRC))
    134134                    mVMCallerAdded = true;
    135135            }
     
    146146
    147147    HRESULT rc() const { return mRC; }
    148     bool isOk() const { return SUCCEEDED (rc()); }
     148    bool isOk() const { return SUCCEEDED(rc()); }
    149149
    150150    /** Releases the Console caller before destruction. Not normally necessary. */
     
    164164    }
    165165
    166     const ComObjPtr <Console> mConsole;
     166    const ComObjPtr<Console> mConsole;
    167167
    168168private:
     
    178178        : VMTask (aConsole, aUsesVMPtr), mProgress (aProgress) {}
    179179
    180     const ComObjPtr <Progress> mProgress;
     180    const ComObjPtr<Progress> mProgress;
    181181
    182182    Utf8Str mErrorMsg;
     
    195195    bool mStartPaused;
    196196
    197     typedef std::list <ComPtr <IHardDisk> > HardDiskList;
     197    typedef std::list <ComPtr<IHardDisk> > HardDiskList;
    198198    HardDiskList hardDisks;
    199199
    200200    /* array of progress objects for hard disk reset operations */
    201     typedef std::list <ComPtr <IProgress> > ProgressList;
     201    typedef std::list <ComPtr<IProgress> > ProgressList;
    202202    ProgressList hardDiskProgresses;
    203203};
     
    213213    Utf8Str mSavedStateFile;
    214214    MachineState_T mLastMachineState;
    215     ComPtr <IProgress> mServerProgress;
     215    ComPtr<IProgress> mServerProgress;
    216216};
    217217
     
    240240HRESULT Console::FinalConstruct()
    241241{
    242     LogFlowThisFunc (("\n"));
     242    LogFlowThisFunc(("\n"));
    243243
    244244    memset(mapFDLeds, 0, sizeof(mapFDLeds));
     
    255255void Console::FinalRelease()
    256256{
    257     LogFlowThisFunc (("\n"));
     257    LogFlowThisFunc(("\n"));
    258258
    259259    uninit();
     
    265265HRESULT Console::init (IMachine *aMachine, IInternalMachineControl *aControl)
    266266{
    267     AssertReturn (aMachine && aControl, E_INVALIDARG);
     267    AssertReturn(aMachine && aControl, E_INVALIDARG);
    268268
    269269    /* Enclose the state transition NotReady->InInit->Ready */
    270     AutoInitSpan autoInitSpan (this);
    271     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     270    AutoInitSpan autoInitSpan(this);
     271    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    272272
    273273    LogFlowThisFuncEnter();
     
    276276    HRESULT rc = E_FAIL;
    277277
    278     unconst (mMachine) = aMachine;
    279     unconst (mControl) = aControl;
     278    unconst(mMachine) = aMachine;
     279    unconst(mControl) = aControl;
    280280
    281281    memset (&mCallbackData, 0, sizeof (mCallbackData));
     
    284284
    285285    rc = mMachine->COMGETTER(State) (&mMachineState);
    286     AssertComRCReturnRC (rc);
     286    AssertComRCReturnRC(rc);
    287287
    288288#ifdef VBOX_WITH_VRDP
    289     rc = mMachine->COMGETTER(VRDPServer) (unconst (mVRDPServer).asOutParam());
    290     AssertComRCReturnRC (rc);
     289    rc = mMachine->COMGETTER(VRDPServer) (unconst(mVRDPServer).asOutParam());
     290    AssertComRCReturnRC(rc);
    291291#endif
    292292
    293     rc = mMachine->COMGETTER(DVDDrive) (unconst (mDVDDrive).asOutParam());
    294     AssertComRCReturnRC (rc);
    295 
    296     rc = mMachine->COMGETTER(FloppyDrive) (unconst (mFloppyDrive).asOutParam());
    297     AssertComRCReturnRC (rc);
     293    rc = mMachine->COMGETTER(DVDDrive) (unconst(mDVDDrive).asOutParam());
     294    AssertComRCReturnRC(rc);
     295
     296    rc = mMachine->COMGETTER(FloppyDrive) (unconst(mFloppyDrive).asOutParam());
     297    AssertComRCReturnRC(rc);
    298298
    299299    /* Create associated child COM objects */
    300300
    301     unconst (mGuest).createObject();
     301    unconst(mGuest).createObject();
    302302    rc = mGuest->init (this);
    303     AssertComRCReturnRC (rc);
    304 
    305     unconst (mKeyboard).createObject();
     303    AssertComRCReturnRC(rc);
     304
     305    unconst(mKeyboard).createObject();
    306306    rc = mKeyboard->init (this);
    307     AssertComRCReturnRC (rc);
    308 
    309     unconst (mMouse).createObject();
     307    AssertComRCReturnRC(rc);
     308
     309    unconst(mMouse).createObject();
    310310    rc = mMouse->init (this);
    311     AssertComRCReturnRC (rc);
    312 
    313     unconst (mDisplay).createObject();
     311    AssertComRCReturnRC(rc);
     312
     313    unconst(mDisplay).createObject();
    314314    rc = mDisplay->init (this);
    315     AssertComRCReturnRC (rc);
    316 
    317     unconst (mRemoteDisplayInfo).createObject();
     315    AssertComRCReturnRC(rc);
     316
     317    unconst(mRemoteDisplayInfo).createObject();
    318318    rc = mRemoteDisplayInfo->init (this);
    319     AssertComRCReturnRC (rc);
     319    AssertComRCReturnRC(rc);
    320320
    321321    /* Grab global and machine shared folder lists */
    322322
    323323    rc = fetchSharedFolders (true /* aGlobal */);
    324     AssertComRCReturnRC (rc);
     324    AssertComRCReturnRC(rc);
    325325    rc = fetchSharedFolders (false /* aGlobal */);
    326     AssertComRCReturnRC (rc);
     326    AssertComRCReturnRC(rc);
    327327
    328328    /* Create other child objects */
    329329
    330     unconst (mConsoleVRDPServer) = new ConsoleVRDPServer (this);
    331     AssertReturn (mConsoleVRDPServer, E_FAIL);
     330    unconst(mConsoleVRDPServer) = new ConsoleVRDPServer (this);
     331    AssertReturn(mConsoleVRDPServer, E_FAIL);
    332332
    333333    mcAudioRefs = 0;
     
    335335    mu32SingleRDPClientId = 0;
    336336
    337     unconst (mVMMDev) = new VMMDev(this);
    338     AssertReturn (mVMMDev, E_FAIL);
    339 
    340     unconst (mAudioSniffer) = new AudioSniffer(this);
    341     AssertReturn (mAudioSniffer, E_FAIL);
     337    unconst(mVMMDev) = new VMMDev(this);
     338    AssertReturn(mVMMDev, E_FAIL);
     339
     340    unconst(mAudioSniffer) = new AudioSniffer(this);
     341    AssertReturn(mAudioSniffer, E_FAIL);
    342342
    343343    /* Confirm a successful initialization when it's the case */
     
    357357
    358358    /* Enclose the state transition Ready->InUninit->NotReady */
    359     AutoUninitSpan autoUninitSpan (this);
     359    AutoUninitSpan autoUninitSpan(this);
    360360    if (autoUninitSpan.uninitDone())
    361361    {
    362         LogFlowThisFunc (("Already uninitialized.\n"));
     362        LogFlowThisFunc(("Already uninitialized.\n"));
    363363        LogFlowThisFuncLeave();
    364364        return;
    365365    }
    366366
    367     LogFlowThisFunc (("initFailed()=%d\n", autoUninitSpan.initFailed()));
     367    LogFlowThisFunc(("initFailed()=%d\n", autoUninitSpan.initFailed()));
    368368
    369369    /*
     
    389389    {
    390390        delete mAudioSniffer;
    391         unconst (mAudioSniffer) = NULL;
     391        unconst(mAudioSniffer) = NULL;
    392392    }
    393393
     
    395395    {
    396396        delete mVMMDev;
    397         unconst (mVMMDev) = NULL;
     397        unconst(mVMMDev) = NULL;
    398398    }
    399399
     
    408408    {
    409409        mRemoteDisplayInfo->uninit();
    410         unconst (mRemoteDisplayInfo).setNull();;
     410        unconst(mRemoteDisplayInfo).setNull();;
    411411    }
    412412
     
    414414    {
    415415        mDebugger->uninit();
    416         unconst (mDebugger).setNull();
     416        unconst(mDebugger).setNull();
    417417    }
    418418
     
    420420    {
    421421        mDisplay->uninit();
    422         unconst (mDisplay).setNull();
     422        unconst(mDisplay).setNull();
    423423    }
    424424
     
    426426    {
    427427        mMouse->uninit();
    428         unconst (mMouse).setNull();
     428        unconst(mMouse).setNull();
    429429    }
    430430
     
    432432    {
    433433        mKeyboard->uninit();
    434         unconst (mKeyboard).setNull();;
     434        unconst(mKeyboard).setNull();;
    435435    }
    436436
     
    438438    {
    439439        mGuest->uninit();
    440         unconst (mGuest).setNull();;
     440        unconst(mGuest).setNull();;
    441441    }
    442442
     
    444444    {
    445445        delete mConsoleVRDPServer;
    446         unconst (mConsoleVRDPServer) = NULL;
    447     }
    448 
    449     unconst (mFloppyDrive).setNull();
    450     unconst (mDVDDrive).setNull();
     446        unconst(mConsoleVRDPServer) = NULL;
     447    }
     448
     449    unconst(mFloppyDrive).setNull();
     450    unconst(mDVDDrive).setNull();
    451451#ifdef VBOX_WITH_VRDP
    452     unconst (mVRDPServer).setNull();
     452    unconst(mVRDPServer).setNull();
    453453#endif
    454454
    455     unconst (mControl).setNull();
    456     unconst (mMachine).setNull();
     455    unconst(mControl).setNull();
     456    unconst(mMachine).setNull();
    457457
    458458    /* Release all callbacks. Do this after uninitializing the components,
     
    580580    LogFlowFunc (("%d, %s, %s, %s\n", u32ClientId, pszUser, pszPassword, pszDomain));
    581581
    582     AutoCaller autoCaller (this);
     582    AutoCaller autoCaller(this);
    583583    if (!autoCaller.isOk())
    584584    {
     
    774774    LogFlowFuncEnter();
    775775
    776     AutoCaller autoCaller (this);
     776    AutoCaller autoCaller(this);
    777777    AssertComRCReturnVoid (autoCaller.rc());
    778778
     
    800800    LogFlowFuncEnter();
    801801
    802     AutoCaller autoCaller (this);
     802    AutoCaller autoCaller(this);
    803803    AssertComRCReturnVoid (autoCaller.rc());
    804804
     
    870870    LogFlowFuncEnter();
    871871
    872     AutoCaller autoCaller (this);
     872    AutoCaller autoCaller(this);
    873873    AssertComRCReturnVoid (autoCaller.rc());
    874874
     
    901901    LogFlowFuncEnter();
    902902
    903     AutoCaller autoCaller (this);
     903    AutoCaller autoCaller(this);
    904904    AssertComRCReturnVoid (autoCaller.rc());
    905905
     
    916916    LogFlowFuncEnter();
    917917
    918     AutoCaller autoCaller (this);
     918    AutoCaller autoCaller(this);
    919919    AssertComRCReturnVoid (autoCaller.rc());
    920920
     
    10021002    AssertReturnVoid (that);
    10031003
    1004     AutoCaller autoCaller (that);
     1004    AutoCaller autoCaller(that);
    10051005    AssertComRCReturnVoid (autoCaller.rc());
    10061006
    1007     AutoReadLock alock (that);
     1007    AutoReadLock alock(that);
    10081008
    10091009    int vrc = SSMR3PutU32 (pSSM, (uint32_t)that->mSharedFolders.size());
     
    10141014         ++ it)
    10151015    {
    1016         ComObjPtr <SharedFolder> folder = (*it).second;
     1016        ComObjPtr<SharedFolder> folder = (*it).second;
    10171017        // don't lock the folder because methods we access are const
    10181018
     
    10561056
    10571057    Console *that = static_cast <Console *> (pvUser);
    1058     AssertReturn (that, VERR_INVALID_PARAMETER);
     1058    AssertReturn(that, VERR_INVALID_PARAMETER);
    10591059
    10601060    /* Currently, nothing to do when we've been called from VMR3Load. */
     
    10761076Console::loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version)
    10771077{
    1078     AutoCaller autoCaller (this);
     1078    AutoCaller autoCaller(this);
    10791079    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    10801080
    1081     AutoWriteLock alock (this);
    1082 
    1083     AssertReturn (mSharedFolders.size() == 0, VERR_INTERNAL_ERROR);
     1081    AutoWriteLock alock(this);
     1082
     1083    AssertReturn(mSharedFolders.size() == 0, VERR_INTERNAL_ERROR);
    10841084
    10851085    uint32_t size = 0;
     
    11151115            SSMR3GetBool (pSSM, &writable);
    11161116
    1117         ComObjPtr <SharedFolder> sharedFolder;
     1117        ComObjPtr<SharedFolder> sharedFolder;
    11181118        sharedFolder.createObject();
    11191119        HRESULT rc = sharedFolder->init (this, name, hostPath, writable);
     
    11411141    AssertReturn(sizeof(HOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);
    11421142    AssertReturn(HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER);
    1143     ComObjPtr <Console> pConsole = reinterpret_cast <Console *> (pvExtension);
     1143    ComObjPtr<Console> pConsole = reinterpret_cast <Console *> (pvExtension);
    11441144    LogFlowFunc (("pCBData->pcszName=%s, pCBData->pcszValue=%s, pCBData->pcszFlags=%s\n", pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags));
    11451145    Bstr name(pCBData->pcszName);
     
    12371237     * And now we create the COM safe arrays and fill them in.
    12381238     */
    1239     com::SafeArray <BSTR> names(cEntries);
    1240     com::SafeArray <BSTR> values(cEntries);
    1241     com::SafeArray <ULONG64> timestamps(cEntries);
    1242     com::SafeArray <BSTR> flags(cEntries);
     1239    com::SafeArray<BSTR> names(cEntries);
     1240    com::SafeArray<BSTR> values(cEntries);
     1241    com::SafeArray<ULONG64> timestamps(cEntries);
     1242    com::SafeArray<BSTR> flags(cEntries);
    12431243    size_t iBuf = 0;
    12441244    /* Rely on the service to have formated the data correctly. */
     
    12581258        iBuf += cchFlags + 1;
    12591259    }
    1260     names.detachTo(ComSafeArrayOutArg (aNames));
    1261     values.detachTo(ComSafeArrayOutArg (aValues));
    1262     timestamps.detachTo(ComSafeArrayOutArg (aTimestamps));
    1263     flags.detachTo(ComSafeArrayOutArg (aFlags));
     1260    names.detachTo(ComSafeArrayOutArg(aNames));
     1261    values.detachTo(ComSafeArrayOutArg(aValues));
     1262    timestamps.detachTo(ComSafeArrayOutArg(aTimestamps));
     1263    flags.detachTo(ComSafeArrayOutArg(aFlags));
    12641264    return S_OK;
    12651265}
     
    12741274    CheckComArgOutPointerValid(aMachine);
    12751275
    1276     AutoCaller autoCaller (this);
    1277     CheckComRCReturnRC (autoCaller.rc());
     1276    AutoCaller autoCaller(this);
     1277    CheckComRCReturnRC(autoCaller.rc());
    12781278
    12791279    /* mMachine is constant during life time, no need to lock */
    1280     mMachine.queryInterfaceTo (aMachine);
     1280    mMachine.queryInterfaceTo(aMachine);
    12811281
    12821282    return S_OK;
     
    12871287    CheckComArgOutPointerValid(aMachineState);
    12881288
    1289     AutoCaller autoCaller (this);
    1290     CheckComRCReturnRC (autoCaller.rc());
    1291 
    1292     AutoReadLock alock (this);
     1289    AutoCaller autoCaller(this);
     1290    CheckComRCReturnRC(autoCaller.rc());
     1291
     1292    AutoReadLock alock(this);
    12931293
    12941294    /* we return our local state (since it's always the same as on the server) */
     
    13021302    CheckComArgOutPointerValid(aGuest);
    13031303
    1304     AutoCaller autoCaller (this);
    1305     CheckComRCReturnRC (autoCaller.rc());
     1304    AutoCaller autoCaller(this);
     1305    CheckComRCReturnRC(autoCaller.rc());
    13061306
    13071307    /* mGuest is constant during life time, no need to lock */
    1308     mGuest.queryInterfaceTo (aGuest);
     1308    mGuest.queryInterfaceTo(aGuest);
    13091309
    13101310    return S_OK;
     
    13151315    CheckComArgOutPointerValid(aKeyboard);
    13161316
    1317     AutoCaller autoCaller (this);
    1318     CheckComRCReturnRC (autoCaller.rc());
     1317    AutoCaller autoCaller(this);
     1318    CheckComRCReturnRC(autoCaller.rc());
    13191319
    13201320    /* mKeyboard is constant during life time, no need to lock */
    1321     mKeyboard.queryInterfaceTo (aKeyboard);
     1321    mKeyboard.queryInterfaceTo(aKeyboard);
    13221322
    13231323    return S_OK;
     
    13281328    CheckComArgOutPointerValid(aMouse);
    13291329
    1330     AutoCaller autoCaller (this);
    1331     CheckComRCReturnRC (autoCaller.rc());
     1330    AutoCaller autoCaller(this);
     1331    CheckComRCReturnRC(autoCaller.rc());
    13321332
    13331333    /* mMouse is constant during life time, no need to lock */
    1334     mMouse.queryInterfaceTo (aMouse);
     1334    mMouse.queryInterfaceTo(aMouse);
    13351335
    13361336    return S_OK;
     
    13411341    CheckComArgOutPointerValid(aDisplay);
    13421342
    1343     AutoCaller autoCaller (this);
    1344     CheckComRCReturnRC (autoCaller.rc());
     1343    AutoCaller autoCaller(this);
     1344    CheckComRCReturnRC(autoCaller.rc());
    13451345
    13461346    /* mDisplay is constant during life time, no need to lock */
    1347     mDisplay.queryInterfaceTo (aDisplay);
     1347    mDisplay.queryInterfaceTo(aDisplay);
    13481348
    13491349    return S_OK;
     
    13541354    CheckComArgOutPointerValid(aDebugger);
    13551355
    1356     AutoCaller autoCaller (this);
    1357     CheckComRCReturnRC (autoCaller.rc());
     1356    AutoCaller autoCaller(this);
     1357    CheckComRCReturnRC(autoCaller.rc());
    13581358
    13591359    /* we need a write lock because of the lazy mDebugger initialization*/
    1360     AutoWriteLock alock (this);
     1360    AutoWriteLock alock(this);
    13611361
    13621362    /* check if we have to create the debugger object */
    13631363    if (!mDebugger)
    13641364    {
    1365         unconst (mDebugger).createObject();
     1365        unconst(mDebugger).createObject();
    13661366        mDebugger->init (this);
    13671367    }
    13681368
    1369     mDebugger.queryInterfaceTo (aDebugger);
     1369    mDebugger.queryInterfaceTo(aDebugger);
    13701370
    13711371    return S_OK;
    13721372}
    13731373
    1374 STDMETHODIMP Console::COMGETTER(USBDevices) (ComSafeArrayOut (IUSBDevice *, aUSBDevices))
     1374STDMETHODIMP Console::COMGETTER(USBDevices) (ComSafeArrayOut(IUSBDevice *, aUSBDevices))
    13751375{
    13761376    CheckComArgOutSafeArrayPointerValid(aUSBDevices);
    13771377
    1378     AutoCaller autoCaller (this);
    1379     CheckComRCReturnRC (autoCaller.rc());
    1380 
    1381     AutoReadLock alock (this);
    1382 
    1383     SafeIfaceArray <IUSBDevice> collection (mUSBDevices);
    1384     collection.detachTo (ComSafeArrayOutArg(aUSBDevices));
     1378    AutoCaller autoCaller(this);
     1379    CheckComRCReturnRC(autoCaller.rc());
     1380
     1381    AutoReadLock alock(this);
     1382
     1383    SafeIfaceArray<IUSBDevice> collection (mUSBDevices);
     1384    collection.detachTo(ComSafeArrayOutArg(aUSBDevices));
    13851385
    13861386    return S_OK;
    13871387}
    13881388
    1389 STDMETHODIMP Console::COMGETTER(RemoteUSBDevices) (ComSafeArrayOut (IHostUSBDevice *, aRemoteUSBDevices))
     1389STDMETHODIMP Console::COMGETTER(RemoteUSBDevices) (ComSafeArrayOut(IHostUSBDevice *, aRemoteUSBDevices))
    13901390{
    13911391    CheckComArgOutSafeArrayPointerValid(aRemoteUSBDevices);
    13921392
    1393     AutoCaller autoCaller (this);
    1394     CheckComRCReturnRC (autoCaller.rc());
    1395 
    1396     AutoReadLock alock (this);
    1397 
    1398     SafeIfaceArray <IHostUSBDevice> collection (mRemoteUSBDevices);
    1399     collection.detachTo (ComSafeArrayOutArg(aRemoteUSBDevices));
     1393    AutoCaller autoCaller(this);
     1394    CheckComRCReturnRC(autoCaller.rc());
     1395
     1396    AutoReadLock alock(this);
     1397
     1398    SafeIfaceArray<IHostUSBDevice> collection (mRemoteUSBDevices);
     1399    collection.detachTo(ComSafeArrayOutArg(aRemoteUSBDevices));
    14001400
    14011401    return S_OK;
     
    14061406    CheckComArgOutPointerValid(aRemoteDisplayInfo);
    14071407
    1408     AutoCaller autoCaller (this);
    1409     CheckComRCReturnRC (autoCaller.rc());
     1408    AutoCaller autoCaller(this);
     1409    CheckComRCReturnRC(autoCaller.rc());
    14101410
    14111411    /* mDisplay is constant during life time, no need to lock */
    1412     mRemoteDisplayInfo.queryInterfaceTo (aRemoteDisplayInfo);
     1412    mRemoteDisplayInfo.queryInterfaceTo(aRemoteDisplayInfo);
    14131413
    14141414    return S_OK;
     
    14161416
    14171417STDMETHODIMP
    1418 Console::COMGETTER(SharedFolders) (ComSafeArrayOut (ISharedFolder *, aSharedFolders))
     1418Console::COMGETTER(SharedFolders) (ComSafeArrayOut(ISharedFolder *, aSharedFolders))
    14191419{
    14201420    CheckComArgOutSafeArrayPointerValid(aSharedFolders);
    14211421
    1422     AutoCaller autoCaller (this);
    1423     CheckComRCReturnRC (autoCaller.rc());
     1422    AutoCaller autoCaller(this);
     1423    CheckComRCReturnRC(autoCaller.rc());
    14241424
    14251425    /* loadDataFromSavedState() needs a write lock */
    1426     AutoWriteLock alock (this);
     1426    AutoWriteLock alock(this);
    14271427
    14281428    /* Read console data stored in the saved state file (if not yet done) */
    14291429    HRESULT rc = loadDataFromSavedState();
    1430     CheckComRCReturnRC (rc);
    1431 
    1432     SafeIfaceArray <ISharedFolder> sf (mSharedFolders);
    1433     sf.detachTo (ComSafeArrayOutArg(aSharedFolders));
     1430    CheckComRCReturnRC(rc);
     1431
     1432    SafeIfaceArray<ISharedFolder> sf (mSharedFolders);
     1433    sf.detachTo(ComSafeArrayOutArg(aSharedFolders));
    14341434
    14351435    return S_OK;
     
    14571457
    14581458    LogFlowThisFuncEnter();
    1459     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
    1460 
    1461     AutoCaller autoCaller (this);
    1462     CheckComRCReturnRC (autoCaller.rc());
    1463 
    1464     AutoWriteLock alock (this);
     1459    LogFlowThisFunc(("mMachineState=%d\n", mMachineState));
     1460
     1461    AutoCaller autoCaller(this);
     1462    CheckComRCReturnRC(autoCaller.rc());
     1463
     1464    AutoWriteLock alock(this);
    14651465
    14661466    if (!Global::IsActive (mMachineState))
     
    14801480    }
    14811481
    1482     LogFlowThisFunc (("Initiating SHUTDOWN request...\n"));
     1482    LogFlowThisFunc(("Initiating SHUTDOWN request...\n"));
    14831483
    14841484    /* create an IProgress object to track progress of this operation */
    1485     ComObjPtr <Progress> progress;
     1485    ComObjPtr<Progress> progress;
    14861486    progress.createObject();
    14871487    progress->init (static_cast <IConsole *> (this),
     
    14921492    std::auto_ptr <VMProgressTask> task (
    14931493        new VMProgressTask (this, progress, true /* aUsesVMPtr */));
    1494     AssertReturn (task->isOk(), E_FAIL);
     1494    AssertReturn(task->isOk(), E_FAIL);
    14951495
    14961496    int vrc = RTThreadCreate (NULL, Console::powerDownThread,
     
    15081508
    15091509    /* pass the progress to the caller */
    1510     progress.queryInterfaceTo (aProgress);
     1510    progress.queryInterfaceTo(aProgress);
    15111511
    15121512    LogFlowThisFuncLeave();
     
    15181518{
    15191519    LogFlowThisFuncEnter();
    1520     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
    1521 
    1522     AutoCaller autoCaller (this);
    1523     CheckComRCReturnRC (autoCaller.rc());
    1524 
    1525     AutoWriteLock alock (this);
     1520    LogFlowThisFunc(("mMachineState=%d\n", mMachineState));
     1521
     1522    AutoCaller autoCaller(this);
     1523    CheckComRCReturnRC(autoCaller.rc());
     1524
     1525    AutoWriteLock alock(this);
    15261526
    15271527    if (mMachineState != MachineState_Running)
     
    15311531    /* protect mpVM */
    15321532    AutoVMCaller autoVMCaller (this);
    1533     CheckComRCReturnRC (autoVMCaller.rc());
     1533    CheckComRCReturnRC(autoVMCaller.rc());
    15341534
    15351535    /* leave the lock before a VMR3* call (EMT will call us back)! */
     
    15411541        setError (VBOX_E_VM_ERROR, tr ("Could not reset the machine (%Rrc)"), vrc);
    15421542
    1543     LogFlowThisFunc (("mMachineState=%d, rc=%08X\n", mMachineState, rc));
     1543    LogFlowThisFunc(("mMachineState=%d, rc=%08X\n", mMachineState, rc));
    15441544    LogFlowThisFuncLeave();
    15451545    return rc;
     
    15501550    LogFlowThisFuncEnter();
    15511551
    1552     AutoCaller autoCaller (this);
    1553     CheckComRCReturnRC (autoCaller.rc());
    1554 
    1555     AutoWriteLock alock (this);
     1552    AutoCaller autoCaller(this);
     1553    CheckComRCReturnRC(autoCaller.rc());
     1554
     1555    AutoWriteLock alock(this);
    15561556
    15571557    if (mMachineState != MachineState_Running)
     
    15611561    /* protect mpVM */
    15621562    AutoVMCaller autoVMCaller (this);
    1563     CheckComRCReturnRC (autoVMCaller.rc());
    1564 
    1565     LogFlowThisFunc (("Sending PAUSE request...\n"));
     1563    CheckComRCReturnRC(autoVMCaller.rc());
     1564
     1565    LogFlowThisFunc(("Sending PAUSE request...\n"));
    15661566
    15671567    /* leave the lock before a VMR3* call (EMT will call us back)! */
     
    15741574            tr ("Could not suspend the machine execution (%Rrc)"), vrc);
    15751575
    1576     LogFlowThisFunc (("rc=%08X\n", rc));
     1576    LogFlowThisFunc(("rc=%08X\n", rc));
    15771577    LogFlowThisFuncLeave();
    15781578    return rc;
     
    15831583    LogFlowThisFuncEnter();
    15841584
    1585     AutoCaller autoCaller (this);
    1586     CheckComRCReturnRC (autoCaller.rc());
    1587 
    1588     AutoWriteLock alock (this);
     1585    AutoCaller autoCaller(this);
     1586    CheckComRCReturnRC(autoCaller.rc());
     1587
     1588    AutoWriteLock alock(this);
    15891589
    15901590    if (mMachineState != MachineState_Paused)
     
    15951595    /* protect mpVM */
    15961596    AutoVMCaller autoVMCaller (this);
    1597     CheckComRCReturnRC (autoVMCaller.rc());
    1598 
    1599     LogFlowThisFunc (("Sending RESUME request...\n"));
     1597    CheckComRCReturnRC(autoVMCaller.rc());
     1598
     1599    LogFlowThisFunc(("Sending RESUME request...\n"));
    16001600
    16011601    /* leave the lock before a VMR3* call (EMT will call us back)! */
     
    16121612            tr ("Could not resume the machine execution (%Rrc)"), vrc);
    16131613
    1614     LogFlowThisFunc (("rc=%08X\n", rc));
     1614    LogFlowThisFunc(("rc=%08X\n", rc));
    16151615    LogFlowThisFuncLeave();
    16161616    return rc;
     
    16211621    LogFlowThisFuncEnter();
    16221622
    1623     AutoCaller autoCaller (this);
    1624     CheckComRCReturnRC (autoCaller.rc());
    1625 
    1626     AutoWriteLock alock (this);
     1623    AutoCaller autoCaller(this);
     1624    CheckComRCReturnRC(autoCaller.rc());
     1625
     1626    AutoWriteLock alock(this);
    16271627
    16281628    if (mMachineState != MachineState_Running)
     
    16321632    /* protect mpVM */
    16331633    AutoVMCaller autoVMCaller (this);
    1634     CheckComRCReturnRC (autoVMCaller.rc());
     1634    CheckComRCReturnRC(autoVMCaller.rc());
    16351635
    16361636    PPDMIBASE pBase;
     
    16481648            tr ("Controlled power off failed (%Rrc)"), vrc);
    16491649
    1650     LogFlowThisFunc (("rc=%08X\n", rc));
     1650    LogFlowThisFunc(("rc=%08X\n", rc));
    16511651    LogFlowThisFuncLeave();
    16521652    return rc;
     
    16611661    *aHandled = FALSE;
    16621662
    1663     AutoCaller autoCaller (this);
    1664 
    1665     AutoWriteLock alock (this);
     1663    AutoCaller autoCaller(this);
     1664
     1665    AutoWriteLock alock(this);
    16661666
    16671667    if (mMachineState != MachineState_Running)
     
    16711671    /* protect mpVM */
    16721672    AutoVMCaller autoVMCaller (this);
    1673     CheckComRCReturnRC (autoVMCaller.rc());
     1673    CheckComRCReturnRC(autoVMCaller.rc());
    16741674
    16751675    PPDMIBASE pBase;
     
    16911691    *aHandled = handled;
    16921692
    1693     LogFlowThisFunc (("rc=%08X\n", rc));
     1693    LogFlowThisFunc(("rc=%08X\n", rc));
    16941694    LogFlowThisFuncLeave();
    16951695    return rc;
     
    17041704    *aEntered = FALSE;
    17051705
    1706     AutoCaller autoCaller (this);
    1707 
    1708     AutoWriteLock alock (this);
     1706    AutoCaller autoCaller(this);
     1707
     1708    AutoWriteLock alock(this);
    17091709
    17101710    if (mMachineState != MachineState_Running)
     
    17151715    /* protect mpVM */
    17161716    AutoVMCaller autoVMCaller (this);
    1717     CheckComRCReturnRC (autoVMCaller.rc());
     1717    CheckComRCReturnRC(autoVMCaller.rc());
    17181718
    17191719    PPDMIBASE pBase;
    17201720    int vrc = PDMR3QueryDeviceLun (mpVM, "acpi", 0, 0, &pBase);
    17211721    bool entered = false;
    1722     if (RT_SUCCESS (vrc))
     1722    if (RT_SUCCESS(vrc))
    17231723    {
    17241724        Assert (pBase);
     
    17281728    }
    17291729
    1730     *aEntered = RT_SUCCESS (vrc) ? entered : false;
     1730    *aEntered = RT_SUCCESS(vrc) ? entered : false;
    17311731
    17321732    LogFlowThisFuncLeave();
     
    17381738    LogFlowThisFuncEnter();
    17391739
    1740     AutoCaller autoCaller (this);
    1741     CheckComRCReturnRC (autoCaller.rc());
    1742 
    1743     AutoWriteLock alock (this);
     1740    AutoCaller autoCaller(this);
     1741    CheckComRCReturnRC(autoCaller.rc());
     1742
     1743    AutoWriteLock alock(this);
    17441744
    17451745    if (mMachineState != MachineState_Running)
     
    17491749    /* protect mpVM */
    17501750    AutoVMCaller autoVMCaller (this);
    1751     CheckComRCReturnRC (autoVMCaller.rc());
     1751    CheckComRCReturnRC(autoVMCaller.rc());
    17521752
    17531753    PPDMIBASE pBase;
     
    17651765            tr ("Sending sleep button event failed (%Rrc)"), vrc);
    17661766
    1767     LogFlowThisFunc (("rc=%08X\n", rc));
     1767    LogFlowThisFunc(("rc=%08X\n", rc));
    17681768    LogFlowThisFuncLeave();
    17691769    return rc;
     
    17731773{
    17741774    LogFlowThisFuncEnter();
    1775     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
     1775    LogFlowThisFunc(("mMachineState=%d\n", mMachineState));
    17761776
    17771777    CheckComArgOutPointerValid(aProgress);
    17781778
    1779     AutoCaller autoCaller (this);
    1780     CheckComRCReturnRC (autoCaller.rc());
    1781 
    1782     AutoWriteLock alock (this);
     1779    AutoCaller autoCaller(this);
     1780    CheckComRCReturnRC(autoCaller.rc());
     1781
     1782    AutoWriteLock alock(this);
    17831783
    17841784    if (mMachineState != MachineState_Running &&
     
    17961796    {
    17971797        HRESULT rc = Pause();
    1798         CheckComRCReturnRC (rc);
     1798        CheckComRCReturnRC(rc);
    17991799    }
    18001800
     
    18021802
    18031803    /* create a progress object to track operation completion */
    1804     ComObjPtr <Progress> progress;
     1804    ComObjPtr<Progress> progress;
    18051805    progress.createObject();
    18061806    progress->init (static_cast <IConsole *> (this),
     
    18771877
    18781878        /* return the progress to the caller */
    1879         progress.queryInterfaceTo (aProgress);
     1879        progress.queryInterfaceTo(aProgress);
    18801880    }
    18811881    while (0);
     
    19071907    }
    19081908
    1909     LogFlowThisFunc (("rc=%08X\n", rc));
     1909    LogFlowThisFunc(("rc=%08X\n", rc));
    19101910    LogFlowThisFuncLeave();
    19111911    return rc;
     
    19161916    CheckComArgNotNull(aSavedStateFile);
    19171917
    1918     AutoCaller autoCaller (this);
    1919     CheckComRCReturnRC (autoCaller.rc());
    1920 
    1921     AutoWriteLock alock (this);
     1918    AutoCaller autoCaller(this);
     1919    CheckComRCReturnRC(autoCaller.rc());
     1920
     1921    AutoWriteLock alock(this);
    19221922
    19231923    if (mMachineState != MachineState_PoweredOff &&
     
    19331933STDMETHODIMP Console::ForgetSavedState(BOOL aRemove)
    19341934{
    1935     AutoCaller autoCaller (this);
    1936     CheckComRCReturnRC (autoCaller.rc());
    1937 
    1938     AutoWriteLock alock (this);
     1935    AutoCaller autoCaller(this);
     1936    CheckComRCReturnRC(autoCaller.rc());
     1937
     1938    AutoWriteLock alock(this);
    19391939
    19401940    if (mMachineState != MachineState_Saved)
     
    19471947
    19481948    rc = mControl->SetRemoveSavedState(aRemove);
    1949     CheckComRCReturnRC (rc);
     1949    CheckComRCReturnRC(rc);
    19501950
    19511951    /*
     
    19731973    CheckComArgNotNull(aDeviceActivity);
    19741974
    1975     AutoCaller autoCaller (this);
    1976     CheckComRCReturnRC (autoCaller.rc());
     1975    AutoCaller autoCaller(this);
     1976    CheckComRCReturnRC(autoCaller.rc());
    19771977
    19781978    /*
     
    20562056{
    20572057#ifdef VBOX_WITH_USB
    2058     AutoCaller autoCaller (this);
    2059     CheckComRCReturnRC (autoCaller.rc());
    2060 
    2061     AutoWriteLock alock (this);
     2058    AutoCaller autoCaller(this);
     2059    CheckComRCReturnRC(autoCaller.rc());
     2060
     2061    AutoWriteLock alock(this);
    20622062
    20632063    if (mMachineState != MachineState_Running &&
     
    20692069    /* protect mpVM */
    20702070    AutoVMCaller autoVMCaller (this);
    2071     CheckComRCReturnRC (autoVMCaller.rc());
     2071    CheckComRCReturnRC(autoVMCaller.rc());
    20722072
    20732073    /* Don't proceed unless we've found the usb controller. */
     
    20842084    /* Request the device capture */
    20852085    HRESULT rc = mControl->CaptureUSBDevice (aId);
    2086     CheckComRCReturnRC (rc);
     2086    CheckComRCReturnRC(rc);
    20872087
    20882088    return rc;
     
    20992099    CheckComArgOutPointerValid(aDevice);
    21002100
    2101     AutoCaller autoCaller (this);
    2102     CheckComRCReturnRC (autoCaller.rc());
    2103 
    2104     AutoWriteLock alock (this);
     2101    AutoCaller autoCaller(this);
     2102    CheckComRCReturnRC(autoCaller.rc());
     2103
     2104    AutoWriteLock alock(this);
    21052105
    21062106    /* Find it. */
    2107     ComObjPtr <OUSBDevice> device;
     2107    ComObjPtr<OUSBDevice> device;
    21082108    USBDeviceList::iterator it = mUSBDevices.begin();
    21092109    Guid uuid(aId);
     
    21352135    HRESULT rc = detachUSBDevice (it);
    21362136
    2137     if (SUCCEEDED (rc))
     2137    if (SUCCEEDED(rc))
    21382138    {
    21392139        /* leave the lock since we don't need it any more (note though that
     
    21632163    *aDevice = NULL;
    21642164
    2165     SafeIfaceArray <IUSBDevice> devsvec;
     2165    SafeIfaceArray<IUSBDevice> devsvec;
    21662166    HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
    2167     CheckComRCReturnRC (rc);
     2167    CheckComRCReturnRC(rc);
    21682168
    21692169    for (size_t i = 0; i < devsvec.size(); ++i)
     
    21712171        Bstr address;
    21722172        rc = devsvec[i]->COMGETTER(Address) (address.asOutParam());
    2173         CheckComRCReturnRC (rc);
     2173        CheckComRCReturnRC(rc);
    21742174        if (address == aAddress)
    21752175        {
     
    21772177            found.createObject();
    21782178            found->init (devsvec[i]);
    2179             return found.queryInterfaceTo (aDevice);
     2179            return found.queryInterfaceTo(aDevice);
    21802180        }
    21812181    }
     
    21982198    *aDevice = NULL;
    21992199
    2200     SafeIfaceArray <IUSBDevice> devsvec;
     2200    SafeIfaceArray<IUSBDevice> devsvec;
    22012201    HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
    2202     CheckComRCReturnRC (rc);
     2202    CheckComRCReturnRC(rc);
    22032203
    22042204    for (size_t i = 0; i < devsvec.size(); ++i)
     
    22062206        Bstr id;
    22072207        rc = devsvec[i]->COMGETTER(Id) (id.asOutParam());
    2208         CheckComRCReturnRC (rc);
     2208        CheckComRCReturnRC(rc);
    22092209        if (id == aId)
    22102210        {
     
    22122212            found.createObject();
    22132213            found->init(devsvec[i]);
    2214             return found.queryInterfaceTo (aDevice);
     2214            return found.queryInterfaceTo(aDevice);
    22152215        }
    22162216    }
     
    22312231    CheckComArgNotNull(aHostPath);
    22322232
    2233     AutoCaller autoCaller (this);
    2234     CheckComRCReturnRC (autoCaller.rc());
    2235 
    2236     AutoWriteLock alock (this);
     2233    AutoCaller autoCaller(this);
     2234    CheckComRCReturnRC(autoCaller.rc());
     2235
     2236    AutoWriteLock alock(this);
    22372237
    22382238    /// @todo see @todo in AttachUSBDevice() about the Paused state
     
    22472247            mMachineState);
    22482248
    2249     ComObjPtr <SharedFolder> sharedFolder;
     2249    ComObjPtr<SharedFolder> sharedFolder;
    22502250    HRESULT rc = findSharedFolder (aName, sharedFolder, false /* aSetError */);
    2251     if (SUCCEEDED (rc))
     2251    if (SUCCEEDED(rc))
    22522252        return setError (VBOX_E_FILE_ERROR,
    22532253            tr ("Shared folder named '%ls' already exists"), aName);
     
    22552255    sharedFolder.createObject();
    22562256    rc = sharedFolder->init (this, aName, aHostPath, aWritable);
    2257     CheckComRCReturnRC (rc);
     2257    CheckComRCReturnRC(rc);
    22582258
    22592259    /* protect mpVM (if not NULL) */
     
    22702270        {
    22712271            rc = removeSharedFolder (aName);
    2272             CheckComRCReturnRC (rc);
     2272            CheckComRCReturnRC(rc);
    22732273        }
    22742274
    22752275        /* second, create the given folder */
    22762276        rc = createSharedFolder (aName, SharedFolderData (aHostPath, aWritable));
    2277         CheckComRCReturnRC (rc);
     2277        CheckComRCReturnRC(rc);
    22782278    }
    22792279
     
    22942294    CheckComArgNotNull(aName);
    22952295
    2296     AutoCaller autoCaller (this);
    2297     CheckComRCReturnRC (autoCaller.rc());
    2298 
    2299     AutoWriteLock alock (this);
     2296    AutoCaller autoCaller(this);
     2297    CheckComRCReturnRC(autoCaller.rc());
     2298
     2299    AutoWriteLock alock(this);
    23002300
    23012301    /// @todo see @todo in AttachUSBDevice() about the Paused state
     
    23102310            mMachineState);
    23112311
    2312     ComObjPtr <SharedFolder> sharedFolder;
     2312    ComObjPtr<SharedFolder> sharedFolder;
    23132313    HRESULT rc = findSharedFolder (aName, sharedFolder, true /* aSetError */);
    2314     CheckComRCReturnRC (rc);
     2314    CheckComRCReturnRC(rc);
    23152315
    23162316    /* protect mpVM (if not NULL) */
     
    23242324        /* first, remove the given folder */
    23252325        rc = removeSharedFolder (aName);
    2326         CheckComRCReturnRC (rc);
     2326        CheckComRCReturnRC(rc);
    23272327
    23282328        /* first, remove the machine or the global folder if there is any */
     
    23522352{
    23532353    LogFlowThisFuncEnter();
    2354     LogFlowThisFunc (("aName='%ls' mMachineState=%08X\n", aName, mMachineState));
     2354    LogFlowThisFunc(("aName='%ls' mMachineState=%08X\n", aName, mMachineState));
    23552355
    23562356    CheckComArgNotNull(aName);
    23572357    CheckComArgOutPointerValid(aProgress);
    23582358
    2359     AutoCaller autoCaller (this);
    2360     CheckComRCReturnRC (autoCaller.rc());
    2361 
    2362     AutoWriteLock alock (this);
     2359    AutoCaller autoCaller(this);
     2360    CheckComRCReturnRC(autoCaller.rc());
     2361
     2362    AutoWriteLock alock(this);
    23632363
    23642364    if (Global::IsTransient (mMachineState))
     
    23762376    {
    23772377        HRESULT rc = Pause();
    2378         CheckComRCReturnRC (rc);
     2378        CheckComRCReturnRC(rc);
    23792379    }
    23802380
     
    23872387     *  (only when creating a snapshot online)
    23882388     */
    2389     ComObjPtr <Progress> saveProgress;
     2389    ComObjPtr<Progress> saveProgress;
    23902390    if (takingSnapshotOnline)
    23912391    {
     
    24202420
    24212421        Bstr stateFilePath;
    2422         ComPtr <IProgress> serverProgress;
     2422        ComPtr<IProgress> serverProgress;
    24232423
    24242424        /*
     
    24512451         *  (only when creating a snapshot online)
    24522452         */
    2453         ComObjPtr <CombinedProgress> combinedProgress;
     2453        ComObjPtr<CombinedProgress> combinedProgress;
    24542454        if (takingSnapshotOnline)
    24552455        {
     
    24782478        }
    24792479
    2480         if (SUCCEEDED (rc))
     2480        if (SUCCEEDED(rc))
    24812481        {
    24822482            /* return the correct progress to the caller */
    24832483            if (combinedProgress)
    2484                 combinedProgress.queryInterfaceTo (aProgress);
     2484                combinedProgress.queryInterfaceTo(aProgress);
    24852485            else
    2486                 serverProgress.queryInterfaceTo (aProgress);
     2486                serverProgress.queryInterfaceTo(aProgress);
    24872487        }
    24882488    }
     
    25162516    }
    25172517
    2518     LogFlowThisFunc (("rc=%08X\n", rc));
     2518    LogFlowThisFunc(("rc=%08X\n", rc));
    25192519    LogFlowThisFuncLeave();
    25202520    return rc;
     
    25262526    CheckComArgOutPointerValid(aProgress);
    25272527
    2528     AutoCaller autoCaller (this);
    2529     CheckComRCReturnRC (autoCaller.rc());
    2530 
    2531     AutoWriteLock alock (this);
     2528    AutoCaller autoCaller(this);
     2529    CheckComRCReturnRC(autoCaller.rc());
     2530
     2531    AutoWriteLock alock(this);
    25322532
    25332533    if (Global::IsOnlineOrTransient (mMachineState))
     
    25392539    MachineState_T machineState = MachineState_Null;
    25402540    HRESULT rc = mControl->DiscardSnapshot (this, aId, &machineState, aProgress);
    2541     CheckComRCReturnRC (rc);
     2541    CheckComRCReturnRC(rc);
    25422542
    25432543    setMachineStateLocally (machineState);
     
    25472547STDMETHODIMP Console::DiscardCurrentState (IProgress **aProgress)
    25482548{
    2549     AutoCaller autoCaller (this);
    2550     CheckComRCReturnRC (autoCaller.rc());
    2551 
    2552     AutoWriteLock alock (this);
     2549    AutoCaller autoCaller(this);
     2550    CheckComRCReturnRC(autoCaller.rc());
     2551
     2552    AutoWriteLock alock(this);
    25532553
    25542554    if (Global::IsOnlineOrTransient (mMachineState))
     
    25602560    MachineState_T machineState = MachineState_Null;
    25612561    HRESULT rc = mControl->DiscardCurrentState (this, &machineState, aProgress);
    2562     CheckComRCReturnRC (rc);
     2562    CheckComRCReturnRC(rc);
    25632563
    25642564    setMachineStateLocally (machineState);
     
    25682568STDMETHODIMP Console::DiscardCurrentSnapshotAndState (IProgress **aProgress)
    25692569{
    2570     AutoCaller autoCaller (this);
    2571     CheckComRCReturnRC (autoCaller.rc());
    2572 
    2573     AutoWriteLock alock (this);
     2570    AutoCaller autoCaller(this);
     2571    CheckComRCReturnRC(autoCaller.rc());
     2572
     2573    AutoWriteLock alock(this);
    25742574
    25752575    if (Global::IsOnlineOrTransient (mMachineState))
     
    25822582    HRESULT rc =
    25832583        mControl->DiscardCurrentSnapshotAndState (this, &machineState, aProgress);
    2584     CheckComRCReturnRC (rc);
     2584    CheckComRCReturnRC(rc);
    25852585
    25862586    setMachineStateLocally (machineState);
     
    25922592    CheckComArgNotNull(aCallback);
    25932593
    2594     AutoCaller autoCaller (this);
    2595     CheckComRCReturnRC (autoCaller.rc());
     2594    AutoCaller autoCaller(this);
     2595    CheckComRCReturnRC(autoCaller.rc());
    25962596
    25972597#if 0 /** @todo r=bird,r=pritesh: must check that the interface id match correct or we might screw up with old code! */
     
    26032603#endif
    26042604
    2605     AutoWriteLock alock (this);
     2605    AutoWriteLock alock(this);
    26062606
    26072607    mCallbacks.push_back (CallbackList::value_type (aCallback));
     
    26412641    CheckComArgNotNull(aCallback);
    26422642
    2643     AutoCaller autoCaller (this);
    2644     CheckComRCReturnRC (autoCaller.rc());
    2645 
    2646     AutoWriteLock alock (this);
     2643    AutoCaller autoCaller(this);
     2644    CheckComRCReturnRC(autoCaller.rc());
     2645
     2646    AutoWriteLock alock(this);
    26472647
    26482648    CallbackList::iterator it;
     
    26702670    LogFlowThisFuncEnter();
    26712671
    2672     AutoCaller autoCaller (this);
    2673     AssertComRCReturnRC (autoCaller.rc());
     2672    AutoCaller autoCaller(this);
     2673    AssertComRCReturnRC(autoCaller.rc());
    26742674
    26752675    /* doDriveChange() needs a write lock */
    2676     AutoWriteLock alock (this);
     2676    AutoWriteLock alock(this);
    26772677
    26782678    /* Ignore callbacks when there's no VM around */
     
    26822682    /* protect mpVM */
    26832683    AutoVMCaller autoVMCaller (this);
    2684     CheckComRCReturnRC (autoVMCaller.rc());
     2684    CheckComRCReturnRC(autoVMCaller.rc());
    26852685
    26862686    /* Get the current DVD state */
     
    26952695        &&  meDVDState == DriveState_NotMounted)
    26962696    {
    2697         LogFlowThisFunc (("Returns (NotMounted -> NotMounted)\n"));
     2697        LogFlowThisFunc(("Returns (NotMounted -> NotMounted)\n"));
    26982698        return S_OK;
    26992699    }
     
    27062706        case DriveState_ImageMounted:
    27072707        {
    2708             ComPtr <IDVDImage> ImagePtr;
     2708            ComPtr<IDVDImage> ImagePtr;
    27092709            rc = mDVDDrive->GetImage (ImagePtr.asOutParam());
    2710             if (SUCCEEDED (rc))
     2710            if (SUCCEEDED(rc))
    27112711                rc = ImagePtr->COMGETTER(Location) (Path.asOutParam());
    27122712            break;
     
    27152715        case DriveState_HostDriveCaptured:
    27162716        {
    2717             ComPtr <IHostDVDDrive> DrivePtr;
     2717            ComPtr<IHostDVDDrive> DrivePtr;
    27182718            BOOL enabled;
    27192719            rc = mDVDDrive->GetHostDrive (DrivePtr.asOutParam());
    2720             if (SUCCEEDED (rc))
     2720            if (SUCCEEDED(rc))
    27212721                rc = DrivePtr->COMGETTER (Name) (Path.asOutParam());
    2722             if (SUCCEEDED (rc))
     2722            if (SUCCEEDED(rc))
    27232723                rc = mDVDDrive->COMGETTER (Passthrough) (&enabled);
    2724             if (SUCCEEDED (rc))
     2724            if (SUCCEEDED(rc))
    27252725                fPassthrough = !!enabled;
    27262726            break;
     
    27372737
    27382738    AssertComRC (rc);
    2739     if (SUCCEEDED (rc))
     2739    if (SUCCEEDED(rc))
    27402740    {
    27412741        rc = doDriveChange ("piix3ide", 0, 2, eState, &meDVDState,
     
    27432743
    27442744        /* notify console callbacks on success */
    2745         if (SUCCEEDED (rc))
     2745        if (SUCCEEDED(rc))
    27462746        {
    27472747            CallbackList::iterator it = mCallbacks.begin();
     
    27512751    }
    27522752
    2753     LogFlowThisFunc (("Returns %Rhrc (%#x)\n", rc, rc));
     2753    LogFlowThisFunc(("Returns %Rhrc (%#x)\n", rc, rc));
    27542754    LogFlowThisFuncLeave();
    27552755    return rc;
     
    27662766    LogFlowThisFuncEnter();
    27672767
    2768     AutoCaller autoCaller (this);
    2769     AssertComRCReturnRC (autoCaller.rc());
     2768    AutoCaller autoCaller(this);
     2769    AssertComRCReturnRC(autoCaller.rc());
    27702770
    27712771    /* doDriveChange() needs a write lock */
    2772     AutoWriteLock alock (this);
     2772    AutoWriteLock alock(this);
    27732773
    27742774    /* Ignore callbacks when there's no VM around */
     
    27782778    /* protect mpVM */
    27792779    AutoVMCaller autoVMCaller (this);
    2780     CheckComRCReturnRC (autoVMCaller.rc());
     2780    CheckComRCReturnRC(autoVMCaller.rc());
    27812781
    27822782    /* Get the current floppy state */
     
    28022802        &&  meFloppyState == DriveState_NotMounted)
    28032803    {
    2804         LogFlowThisFunc (("Returns (NotMounted -> NotMounted)\n"));
     2804        LogFlowThisFunc(("Returns (NotMounted -> NotMounted)\n"));
    28052805        return S_OK;
    28062806    }
     
    28142814            ComPtr<IFloppyImage> ImagePtr;
    28152815            rc = mFloppyDrive->GetImage (ImagePtr.asOutParam());
    2816             if (SUCCEEDED (rc))
     2816            if (SUCCEEDED(rc))
    28172817                rc = ImagePtr->COMGETTER(Location) (Path.asOutParam());
    28182818            break;
     
    28212821        case DriveState_HostDriveCaptured:
    28222822        {
    2823             ComPtr <IHostFloppyDrive> DrivePtr;
     2823            ComPtr<IHostFloppyDrive> DrivePtr;
    28242824            rc = mFloppyDrive->GetHostDrive (DrivePtr.asOutParam());
    2825             if (SUCCEEDED (rc))
     2825            if (SUCCEEDED(rc))
    28262826                rc = DrivePtr->COMGETTER (Name) (Path.asOutParam());
    28272827            break;
     
    28382838
    28392839    AssertComRC (rc);
    2840     if (SUCCEEDED (rc))
     2840    if (SUCCEEDED(rc))
    28412841    {
    28422842        rc = doDriveChange ("i82078", 0, 0, eState, &meFloppyState,
     
    28442844
    28452845        /* notify console callbacks on success */
    2846         if (SUCCEEDED (rc))
     2846        if (SUCCEEDED(rc))
    28472847        {
    28482848            CallbackList::iterator it = mCallbacks.begin();
     
    28522852    }
    28532853
    2854     LogFlowThisFunc (("Returns %Rhrc (%#x)\n", rc, rc));
     2854    LogFlowThisFunc(("Returns %Rhrc (%#x)\n", rc, rc));
    28552855    LogFlowThisFuncLeave();
    28562856    return rc;
     
    28802880                                DriveState_T *peState, const char *pszPath, bool fPassthrough)
    28812881{
    2882     LogFlowThisFunc (("pszDevice=%p:{%s} uInstance=%u uLun=%u eState=%d "
     2882    LogFlowThisFunc(("pszDevice=%p:{%s} uInstance=%u uLun=%u eState=%d "
    28832883                      "peState=%p:{%d} pszPath=%p:{%s} fPassthrough=%d\n",
    28842884                      pszDevice, pszDevice, uInstance, uLun, eState,
    28852885                      peState, *peState, pszPath, pszPath, fPassthrough));
    28862886
    2887     AutoCaller autoCaller (this);
    2888     AssertComRCReturnRC (autoCaller.rc());
     2887    AutoCaller autoCaller(this);
     2888    AssertComRCReturnRC(autoCaller.rc());
    28892889
    28902890    /* We will need to release the write lock before calling EMT */
    2891     AutoWriteLock alock (this);
     2891    AutoWriteLock alock(this);
    28922892
    28932893    /* protect mpVM */
    28942894    AutoVMCaller autoVMCaller (this);
    2895     CheckComRCReturnRC (autoVMCaller.rc());
     2895    CheckComRCReturnRC(autoVMCaller.rc());
    28962896
    28972897    /*
     
    29242924    if (VBOX_SUCCESS (vrc))
    29252925    {
    2926         LogFlowThisFunc (("Returns S_OK\n"));
     2926        LogFlowThisFunc(("Returns S_OK\n"));
    29272927        return S_OK;
    29282928    }
     
    29672967                  peState, *peState, pszPath, pszPath, fPassthrough));
    29682968
    2969     AssertReturn (pThis, VERR_INVALID_PARAMETER);
     2969    AssertReturn(pThis, VERR_INVALID_PARAMETER);
    29702970
    29712971    AssertMsg (    (!strcmp (pszDevice, "i82078")  && uLun == 0 && uInstance == 0)
     
    29732973               ("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance));
    29742974
    2975     AutoCaller autoCaller (pThis);
     2975    AutoCaller autoCaller(pThis);
    29762976    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    29772977
    29782978    /* protect mpVM */
    29792979    AutoVMCaller autoVMCaller (pThis);
    2980     CheckComRCReturnRC (autoVMCaller.rc());
     2980    CheckComRCReturnRC(autoVMCaller.rc());
    29812981
    29822982    PVM pVM = pThis->mpVM;
     
    30273027       peState).
    30283028     */
    3029     AutoWriteLock alock (pThis);
     3029    AutoWriteLock alock(pThis);
    30303030
    30313031    do
     
    32753275HRESULT Console::onNetworkAdapterChange (INetworkAdapter *aNetworkAdapter)
    32763276{
    3277     LogFlowThisFunc (("\n"));
    3278 
    3279     AutoCaller autoCaller (this);
    3280     AssertComRCReturnRC (autoCaller.rc());
    3281 
    3282     AutoWriteLock alock (this);
     3277    LogFlowThisFunc(("\n"));
     3278
     3279    AutoCaller autoCaller(this);
     3280    AssertComRCReturnRC(autoCaller.rc());
     3281
     3282    AutoWriteLock alock(this);
    32833283
    32843284    /* Don't do anything if the VM isn't running */
     
    32883288    /* protect mpVM */
    32893289    AutoVMCaller autoVMCaller (this);
    3290     CheckComRCReturnRC (autoVMCaller.rc());
     3290    CheckComRCReturnRC(autoVMCaller.rc());
    32913291
    32923292#ifdef VBOX_DYNAMIC_NET_ATTACH
     
    33183318        rc = aNetworkAdapter->COMGETTER(Slot) (&ulInstance);
    33193319        AssertComRC (rc);
    3320         if (SUCCEEDED (rc))
     3320        if (SUCCEEDED(rc))
    33213321        {
    33223322            /*
     
    34063406
    34073407    /* notify console callbacks on success */
    3408     if (SUCCEEDED (rc))
     3408    if (SUCCEEDED(rc))
    34093409    {
    34103410        CallbackList::iterator it = mCallbacks.begin();
     
    34133413    }
    34143414
    3415     LogFlowThisFunc (("Leaving rc=%#x\n", rc));
     3415    LogFlowThisFunc(("Leaving rc=%#x\n", rc));
    34163416    return rc;
    34173417}
     
    34363436                                         INetworkAdapter *aNetworkAdapter)
    34373437{
    3438     LogFlowThisFunc (("pszDevice=%p:{%s} uInstance=%u uLun=%u aNetworkAdapter=%p\n",
     3438    LogFlowThisFunc(("pszDevice=%p:{%s} uInstance=%u uLun=%u aNetworkAdapter=%p\n",
    34393439                      pszDevice, pszDevice, uInstance, uLun, aNetworkAdapter));
    34403440
    3441     AutoCaller autoCaller (this);
    3442     AssertComRCReturnRC (autoCaller.rc());
     3441    AutoCaller autoCaller(this);
     3442    AssertComRCReturnRC(autoCaller.rc());
    34433443
    34443444    /* We will need to release the write lock before calling EMT */
    3445     AutoWriteLock alock (this);
     3445    AutoWriteLock alock(this);
    34463446
    34473447    /* protect mpVM */
    34483448    AutoVMCaller autoVMCaller (this);
    3449     CheckComRCReturnRC (autoVMCaller.rc());
     3449    CheckComRCReturnRC(autoVMCaller.rc());
    34503450
    34513451    /*
     
    34733473    if (VBOX_SUCCESS (vrc))
    34743474    {
    3475         LogFlowThisFunc (("Returns S_OK\n"));
     3475        LogFlowThisFunc(("Returns S_OK\n"));
    34763476        return S_OK;
    34773477    }
     
    35053505                  pThis, pszDevice, pszDevice, uInstance, uLun, aNetworkAdapter));
    35063506
    3507     AssertReturn (pThis, VERR_INVALID_PARAMETER);
     3507    AssertReturn(pThis, VERR_INVALID_PARAMETER);
    35083508
    35093509    AssertMsg (   (!strcmp (pszDevice, "pcnet") && uLun == 0 && uInstance < SchemaDefs::NetworkAdapterCount)
     
    35123512    Log(("pszDevice=%s uLun=%d uInstance=%d\n", pszDevice, uLun, uInstance));
    35133513
    3514     AutoCaller autoCaller (pThis);
     3514    AutoCaller autoCaller(pThis);
    35153515    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    35163516
    35173517    /* protect mpVM */
    35183518    AutoVMCaller autoVMCaller (pThis);
    3519     CheckComRCReturnRC (autoVMCaller.rc());
     3519    CheckComRCReturnRC(autoVMCaller.rc());
    35203520
    35213521    PVM pVM = pThis->mpVM;
     
    36073607HRESULT Console::onSerialPortChange (ISerialPort *aSerialPort)
    36083608{
    3609     LogFlowThisFunc (("\n"));
    3610 
    3611     AutoCaller autoCaller (this);
    3612     AssertComRCReturnRC (autoCaller.rc());
    3613 
    3614     AutoWriteLock alock (this);
     3609    LogFlowThisFunc(("\n"));
     3610
     3611    AutoCaller autoCaller(this);
     3612    AssertComRCReturnRC(autoCaller.rc());
     3613
     3614    AutoWriteLock alock(this);
    36153615
    36163616    /* Don't do anything if the VM isn't running */
     
    36223622    /* protect mpVM */
    36233623    AutoVMCaller autoVMCaller (this);
    3624     CheckComRCReturnRC (autoVMCaller.rc());
     3624    CheckComRCReturnRC(autoVMCaller.rc());
    36253625
    36263626    /* nothing to do so far */
    36273627
    36283628    /* notify console callbacks on success */
    3629     if (SUCCEEDED (rc))
     3629    if (SUCCEEDED(rc))
    36303630    {
    36313631        CallbackList::iterator it = mCallbacks.begin();
     
    36343634    }
    36353635
    3636     LogFlowThisFunc (("Leaving rc=%#x\n", rc));
     3636    LogFlowThisFunc(("Leaving rc=%#x\n", rc));
    36373637    return rc;
    36383638}
     
    36453645HRESULT Console::onParallelPortChange (IParallelPort *aParallelPort)
    36463646{
    3647     LogFlowThisFunc (("\n"));
    3648 
    3649     AutoCaller autoCaller (this);
    3650     AssertComRCReturnRC (autoCaller.rc());
    3651 
    3652     AutoWriteLock alock (this);
     3647    LogFlowThisFunc(("\n"));
     3648
     3649    AutoCaller autoCaller(this);
     3650    AssertComRCReturnRC(autoCaller.rc());
     3651
     3652    AutoWriteLock alock(this);
    36533653
    36543654    /* Don't do anything if the VM isn't running */
     
    36603660    /* protect mpVM */
    36613661    AutoVMCaller autoVMCaller (this);
    3662     CheckComRCReturnRC (autoVMCaller.rc());
     3662    CheckComRCReturnRC(autoVMCaller.rc());
    36633663
    36643664    /* nothing to do so far */
    36653665
    36663666    /* notify console callbacks on success */
    3667     if (SUCCEEDED (rc))
     3667    if (SUCCEEDED(rc))
    36683668    {
    36693669        CallbackList::iterator it = mCallbacks.begin();
     
    36723672    }
    36733673
    3674     LogFlowThisFunc (("Leaving rc=%#x\n", rc));
     3674    LogFlowThisFunc(("Leaving rc=%#x\n", rc));
    36753675    return rc;
    36763676}
     
    36833683HRESULT Console::onStorageControllerChange ()
    36843684{
    3685     LogFlowThisFunc (("\n"));
    3686 
    3687     AutoCaller autoCaller (this);
    3688     AssertComRCReturnRC (autoCaller.rc());
    3689 
    3690     AutoWriteLock alock (this);
     3685    LogFlowThisFunc(("\n"));
     3686
     3687    AutoCaller autoCaller(this);
     3688    AssertComRCReturnRC(autoCaller.rc());
     3689
     3690    AutoWriteLock alock(this);
    36913691
    36923692    /* Don't do anything if the VM isn't running */
     
    36983698    /* protect mpVM */
    36993699    AutoVMCaller autoVMCaller (this);
    3700     CheckComRCReturnRC (autoVMCaller.rc());
     3700    CheckComRCReturnRC(autoVMCaller.rc());
    37013701
    37023702    /* nothing to do so far */
    37033703
    37043704    /* notify console callbacks on success */
    3705     if (SUCCEEDED (rc))
     3705    if (SUCCEEDED(rc))
    37063706    {
    37073707        CallbackList::iterator it = mCallbacks.begin();
     
    37103710    }
    37113711
    3712     LogFlowThisFunc (("Leaving rc=%#x\n", rc));
     3712    LogFlowThisFunc(("Leaving rc=%#x\n", rc));
    37133713    return rc;
    37143714}
     
    37213721HRESULT Console::onVRDPServerChange()
    37223722{
    3723     AutoCaller autoCaller (this);
    3724     AssertComRCReturnRC (autoCaller.rc());
    3725 
    3726     AutoWriteLock alock (this);
     3723    AutoCaller autoCaller(this);
     3724    AssertComRCReturnRC(autoCaller.rc());
     3725
     3726    AutoWriteLock alock(this);
    37273727
    37283728    HRESULT rc = S_OK;
     
    37633763
    37643764    /* notify console callbacks on success */
    3765     if (SUCCEEDED (rc))
     3765    if (SUCCEEDED(rc))
    37663766    {
    37673767        CallbackList::iterator it = mCallbacks.begin();
     
    37803780HRESULT Console::onUSBControllerChange()
    37813781{
    3782     LogFlowThisFunc (("\n"));
    3783 
    3784     AutoCaller autoCaller (this);
    3785     AssertComRCReturnRC (autoCaller.rc());
    3786 
    3787     AutoWriteLock alock (this);
     3782    LogFlowThisFunc(("\n"));
     3783
     3784    AutoCaller autoCaller(this);
     3785    AssertComRCReturnRC(autoCaller.rc());
     3786
     3787    AutoWriteLock alock(this);
    37883788
    37893789    /* Ignore if no VM is running yet. */
     
    38023802//    /* protect mpVM */
    38033803//    AutoVMCaller autoVMCaller (this);
    3804 //    CheckComRCReturnRC (autoVMCaller.rc());
     3804//    CheckComRCReturnRC(autoVMCaller.rc());
    38053805
    38063806    /* notify console callbacks on success */
    3807     if (SUCCEEDED (rc))
     3807    if (SUCCEEDED(rc))
    38083808    {
    38093809        CallbackList::iterator it = mCallbacks.begin();
     
    38223822HRESULT Console::onSharedFolderChange (BOOL aGlobal)
    38233823{
    3824     LogFlowThisFunc (("aGlobal=%RTbool\n", aGlobal));
    3825 
    3826     AutoCaller autoCaller (this);
    3827     AssertComRCReturnRC (autoCaller.rc());
    3828 
    3829     AutoWriteLock alock (this);
     3824    LogFlowThisFunc(("aGlobal=%RTbool\n", aGlobal));
     3825
     3826    AutoCaller autoCaller(this);
     3827    AssertComRCReturnRC(autoCaller.rc());
     3828
     3829    AutoWriteLock alock(this);
    38303830
    38313831    HRESULT rc = fetchSharedFolders (aGlobal);
    38323832
    38333833    /* notify console callbacks on success */
    3834     if (SUCCEEDED (rc))
     3834    if (SUCCEEDED(rc))
    38353835    {
    38363836        CallbackList::iterator it = mCallbacks.begin();
     
    38613861{
    38623862#ifdef VBOX_WITH_USB
    3863     LogFlowThisFunc (("aDevice=%p aError=%p\n", aDevice, aError));
    3864 
    3865     AutoCaller autoCaller (this);
     3863    LogFlowThisFunc(("aDevice=%p aError=%p\n", aDevice, aError));
     3864
     3865    AutoCaller autoCaller(this);
    38663866    ComAssertComRCRetRC (autoCaller.rc());
    38673867
    3868     AutoWriteLock alock (this);
     3868    AutoWriteLock alock(this);
    38693869
    38703870    /* protect mpVM (we don't need error info, since it's a callback) */
     
    38753875         * (e.g. it may be Saving or Stopping or just PoweredOff) --
    38763876         * autoVMCaller.rc() will return a failure in this case. */
    3877         LogFlowThisFunc (("Attach request ignored (mMachineState=%d).\n",
     3877        LogFlowThisFunc(("Attach request ignored (mMachineState=%d).\n",
    38783878                          mMachineState));
    38793879        return autoVMCaller.rc();
     
    38903890    if (!PDMR3USBHasHub (mpVM))
    38913891    {
    3892         LogFlowThisFunc (("Attach request ignored (no USB controller).\n"));
     3892        LogFlowThisFunc(("Attach request ignored (no USB controller).\n"));
    38933893        return E_FAIL;
    38943894    }
     
    39003900        com::ErrorInfoKeeper eik;
    39013901        /* the error must be a VirtualBoxErrorInfo instance */
    3902         ComPtr <IVirtualBoxErrorInfo> error = eik.takeError();
     3902        ComPtr<IVirtualBoxErrorInfo> error = eik.takeError();
    39033903        Assert (!error.isNull());
    39043904        if (!error.isNull())
     
    39273927#ifdef VBOX_WITH_USB
    39283928    Guid Uuid (aId);
    3929     LogFlowThisFunc (("aId={%RTuuid} aError=%p\n", Uuid.raw(), aError));
    3930 
    3931     AutoCaller autoCaller (this);
    3932     AssertComRCReturnRC (autoCaller.rc());
    3933 
    3934     AutoWriteLock alock (this);
     3929    LogFlowThisFunc(("aId={%RTuuid} aError=%p\n", Uuid.raw(), aError));
     3930
     3931    AutoCaller autoCaller(this);
     3932    AssertComRCReturnRC(autoCaller.rc());
     3933
     3934    AutoWriteLock alock(this);
    39353935
    39363936    /* Find the device. */
    3937     ComObjPtr <OUSBDevice> device;
     3937    ComObjPtr<OUSBDevice> device;
    39383938    USBDeviceList::iterator it = mUSBDevices.begin();
    39393939    while (it != mUSBDevices.end())
    39403940    {
    3941         LogFlowThisFunc (("it={%RTuuid}\n", (*it)->id().raw()));
     3941        LogFlowThisFunc(("it={%RTuuid}\n", (*it)->id().raw()));
    39423942        if ((*it)->id() == Uuid)
    39433943        {
     
    39513951    if (device.isNull())
    39523952    {
    3953         LogFlowThisFunc (("USB device not found.\n"));
     3953        LogFlowThisFunc(("USB device not found.\n"));
    39543954
    39553955        /* The VM may be no more operational when this message arrives
     
    39613961        if (FAILED (autoVMCaller.rc()))
    39623962        {
    3963             LogFlowThisFunc (("Detach request ignored (mMachineState=%d).\n",
     3963            LogFlowThisFunc(("Detach request ignored (mMachineState=%d).\n",
    39643964                              mMachineState));
    39653965            return autoVMCaller.rc();
     
    39843984        com::ErrorInfoKeeper eik;
    39853985        /* the error must be a VirtualBoxErrorInfo instance */
    3986         ComPtr <IVirtualBoxErrorInfo> error = eik.takeError();
     3986        ComPtr<IVirtualBoxErrorInfo> error = eik.takeError();
    39873987        Assert (!error.isNull());
    39883988        if (!error.isNull())
     
    40184018        return E_POINTER;
    40194019
    4020     AutoCaller autoCaller (this);
    4021     AssertComRCReturnRC (autoCaller.rc());
     4020    AutoCaller autoCaller(this);
     4021    AssertComRCReturnRC(autoCaller.rc());
    40224022
    40234023    /* protect mpVM (if not NULL) */
    40244024    AutoVMCallerWeak autoVMCaller (this);
    4025     CheckComRCReturnRC (autoVMCaller.rc());
     4025    CheckComRCReturnRC(autoVMCaller.rc());
    40264026
    40274027    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    40494049        AssertLogRel (vrc != VERR_BUFFER_OVERFLOW);
    40504050        AssertLogRel (RT_FAILURE(vrc) || VBOX_HGCM_SVC_PARM_64BIT == parm[2].type);
    4051         if (RT_SUCCESS (vrc) || (VERR_NOT_FOUND == vrc))
     4051        if (RT_SUCCESS(vrc) || (VERR_NOT_FOUND == vrc))
    40524052        {
    40534053            rc = S_OK;
     
    40924092        return E_INVALIDARG;
    40934093
    4094     AutoCaller autoCaller (this);
    4095     AssertComRCReturnRC (autoCaller.rc());
     4094    AutoCaller autoCaller(this);
     4095    AssertComRCReturnRC(autoCaller.rc());
    40964096
    40974097    /* protect mpVM (if not NULL) */
    40984098    AutoVMCallerWeak autoVMCaller (this);
    4099     CheckComRCReturnRC (autoVMCaller.rc());
     4099    CheckComRCReturnRC(autoVMCaller.rc());
    41004100
    41014101    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    41384138        vrc = mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", DEL_PROP_HOST,
    41394139                                     1, &parm[0]);
    4140     if (RT_SUCCESS (vrc))
     4140    if (RT_SUCCESS(vrc))
    41414141        rc = S_OK;
    41424142    else
     
    41624162    if (!VALID_PTR (aPatterns) && (aPatterns != NULL))
    41634163        return E_POINTER;
    4164     if (ComSafeArrayOutIsNull (aNames))
     4164    if (ComSafeArrayOutIsNull(aNames))
    41654165        return E_POINTER;
    4166     if (ComSafeArrayOutIsNull (aValues))
     4166    if (ComSafeArrayOutIsNull(aValues))
    41674167        return E_POINTER;
    4168     if (ComSafeArrayOutIsNull (aTimestamps))
     4168    if (ComSafeArrayOutIsNull(aTimestamps))
    41694169        return E_POINTER;
    4170     if (ComSafeArrayOutIsNull (aFlags))
     4170    if (ComSafeArrayOutIsNull(aFlags))
    41714171        return E_POINTER;
    41724172
    4173     AutoCaller autoCaller (this);
    4174     AssertComRCReturnRC (autoCaller.rc());
     4173    AutoCaller autoCaller(this);
     4174    AssertComRCReturnRC(autoCaller.rc());
    41754175
    41764176    /* protect mpVM (if not NULL) */
    41774177    AutoVMCallerWeak autoVMCaller (this);
    4178     CheckComRCReturnRC (autoVMCaller.rc());
     4178    CheckComRCReturnRC(autoVMCaller.rc());
    41794179
    41804180    /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
     
    41984198HRESULT Console::updateMachineState (MachineState_T aMachineState)
    41994199{
    4200     AutoCaller autoCaller (this);
    4201     AssertComRCReturnRC (autoCaller.rc());
    4202 
    4203     AutoWriteLock alock (this);
    4204 
    4205     AssertReturn (mMachineState == MachineState_Saving ||
     4200    AutoCaller autoCaller(this);
     4201    AssertComRCReturnRC(autoCaller.rc());
     4202
     4203    AutoWriteLock alock(this);
     4204
     4205    AssertReturn(mMachineState == MachineState_Saving ||
    42064206                  mMachineState == MachineState_Discarding,
    42074207                  E_FAIL);
     
    42204220#if 0
    42214221    LogFlowThisFuncEnter();
    4222     LogFlowThisFunc (("fVisible=%d, fAlpha=%d, xHot = %d, yHot = %d, width=%d, "
     4222    LogFlowThisFunc(("fVisible=%d, fAlpha=%d, xHot = %d, yHot = %d, width=%d, "
    42234223                      "height=%d, shape=%p\n",
    42244224                      fVisible, fAlpha, xHot, yHot, width, height, pShape));
    42254225#endif
    42264226
    4227     AutoCaller autoCaller (this);
     4227    AutoCaller autoCaller(this);
    42284228    AssertComRCReturnVoid (autoCaller.rc());
    42294229
    42304230    /* We need a write lock because we alter the cached callback data */
    4231     AutoWriteLock alock (this);
     4231    AutoWriteLock alock(this);
    42324232
    42334233    /* Save the callback arguments */
     
    42894289void Console::onMouseCapabilityChange (BOOL supportsAbsolute, BOOL needsHostCursor)
    42904290{
    4291     LogFlowThisFunc (("supportsAbsolute=%d needsHostCursor=%d\n",
     4291    LogFlowThisFunc(("supportsAbsolute=%d needsHostCursor=%d\n",
    42924292                      supportsAbsolute, needsHostCursor));
    42934293
    4294     AutoCaller autoCaller (this);
     4294    AutoCaller autoCaller(this);
    42954295    AssertComRCReturnVoid (autoCaller.rc());
    42964296
    42974297    /* We need a write lock because we alter the cached callback data */
    4298     AutoWriteLock alock (this);
     4298    AutoWriteLock alock(this);
    42994299
    43004300    /* save the callback arguments */
     
    43164316void Console::onStateChange (MachineState_T machineState)
    43174317{
    4318     AutoCaller autoCaller (this);
     4318    AutoCaller autoCaller(this);
    43194319    AssertComRCReturnVoid (autoCaller.rc());
    43204320
    4321     AutoReadLock alock (this);
     4321    AutoReadLock alock(this);
    43224322
    43234323    CallbackList::iterator it = mCallbacks.begin();
     
    43314331void Console::onAdditionsStateChange()
    43324332{
    4333     AutoCaller autoCaller (this);
     4333    AutoCaller autoCaller(this);
    43344334    AssertComRCReturnVoid (autoCaller.rc());
    43354335
    4336     AutoReadLock alock (this);
     4336    AutoReadLock alock(this);
    43374337
    43384338    CallbackList::iterator it = mCallbacks.begin();
     
    43464346void Console::onAdditionsOutdated()
    43474347{
    4348     AutoCaller autoCaller (this);
     4348    AutoCaller autoCaller(this);
    43494349    AssertComRCReturnVoid (autoCaller.rc());
    43504350
    4351     AutoReadLock alock (this);
     4351    AutoReadLock alock(this);
    43524352
    43534353    /** @todo Use the On-Screen Display feature to report the fact.
     
    43634363void Console::onKeyboardLedsChange(bool fNumLock, bool fCapsLock, bool fScrollLock)
    43644364{
    4365     AutoCaller autoCaller (this);
     4365    AutoCaller autoCaller(this);
    43664366    AssertComRCReturnVoid (autoCaller.rc());
    43674367
    43684368    /* We need a write lock because we alter the cached callback data */
    4369     AutoWriteLock alock (this);
     4369    AutoWriteLock alock(this);
    43704370
    43714371    /* save the callback arguments */
     
    43864386                                      IVirtualBoxErrorInfo *aError)
    43874387{
    4388     AutoCaller autoCaller (this);
     4388    AutoCaller autoCaller(this);
    43894389    AssertComRCReturnVoid (autoCaller.rc());
    43904390
    4391     AutoReadLock alock (this);
     4391    AutoReadLock alock(this);
    43924392
    43934393    CallbackList::iterator it = mCallbacks.begin();
     
    44014401void Console::onRuntimeError (BOOL aFatal, IN_BSTR aErrorID, IN_BSTR aMessage)
    44024402{
    4403     AutoCaller autoCaller (this);
     4403    AutoCaller autoCaller(this);
    44044404    AssertComRCReturnVoid (autoCaller.rc());
    44054405
    4406     AutoReadLock alock (this);
     4406    AutoReadLock alock(this);
    44074407
    44084408    CallbackList::iterator it = mCallbacks.begin();
     
    44164416HRESULT Console::onShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId)
    44174417{
    4418     AssertReturn (aCanShow, E_POINTER);
    4419     AssertReturn (aWinId, E_POINTER);
     4418    AssertReturn(aCanShow, E_POINTER);
     4419    AssertReturn(aWinId, E_POINTER);
    44204420
    44214421    *aCanShow = FALSE;
    44224422    *aWinId = 0;
    44234423
    4424     AutoCaller autoCaller (this);
    4425     AssertComRCReturnRC (autoCaller.rc());
    4426 
    4427     AutoReadLock alock (this);
     4424    AutoCaller autoCaller(this);
     4425    AssertComRCReturnRC(autoCaller.rc());
     4426
     4427    AutoReadLock alock(this);
    44284428
    44294429    HRESULT rc = S_OK;
     
    44914491{
    44924492    AutoCaller  autoCaller (this);
    4493     AssertComRCReturnRC (autoCaller.rc());
    4494 
    4495     AutoWriteLock alock (this);
     4493    AssertComRCReturnRC(autoCaller.rc());
     4494
     4495    AutoWriteLock alock(this);
    44964496
    44974497    if (mVMDestroying)
     
    45274527    AssertComRCReturnVoid (autoCaller.rc());
    45284528
    4529     AutoWriteLock alock (this);
     4529    AutoWriteLock alock(this);
    45304530
    45314531    AssertReturnVoid (mpVM != NULL);
     
    45474547 * Note that the logic must be in sync with Machine::DeleteSettings().
    45484548 */
    4549 HRESULT Console::consoleInitReleaseLog (const ComPtr <IMachine> aMachine)
     4549HRESULT Console::consoleInitReleaseLog (const ComPtr<IMachine> aMachine)
    45504550{
    45514551    HRESULT hrc = S_OK;
     
    45534553    Bstr logFolder;
    45544554    hrc = aMachine->COMGETTER(LogFolder) (logFolder.asOutParam());
    4555     CheckComRCReturnRC (hrc);
     4555    CheckComRCReturnRC(hrc);
    45564556
    45574557    Utf8Str logDir = logFolder;
     
    45744574    ComPtr<IVirtualBox> virtualBox;
    45754575    aMachine->COMGETTER(Parent)(virtualBox.asOutParam());
    4576     ComPtr <ISystemProperties> systemProperties;
     4576    ComPtr<ISystemProperties> systemProperties;
    45774577    virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    45784578    ULONG uLogHistoryCount = 3;
    45794579    systemProperties->COMGETTER(LogHistoryCount)(&uLogHistoryCount);
    4580     ComPtr <IHost> host;
     4580    ComPtr<IHost> host;
    45814581    virtualBox->COMGETTER(Host)(host.asOutParam());
    45824582    ULONG uHostRamMb = 0, uHostRamAvailMb = 0;
     
    46854685
    46864686    LogFlowThisFuncEnter();
    4687     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
    4688 
    4689     AutoCaller autoCaller (this);
    4690     CheckComRCReturnRC (autoCaller.rc());
    4691 
    4692     AutoWriteLock alock (this);
     4687    LogFlowThisFunc(("mMachineState=%d\n", mMachineState));
     4688
     4689    AutoCaller autoCaller(this);
     4690    CheckComRCReturnRC(autoCaller.rc());
     4691
     4692    AutoWriteLock alock(this);
    46934693
    46944694    if (Global::IsOnlineOrTransient (mMachineState))
     
    47474747    /* Read console data stored in the saved state file (if not yet done) */
    47484748    rc = loadDataFromSavedState();
    4749     CheckComRCReturnRC (rc);
     4749    CheckComRCReturnRC(rc);
    47504750
    47514751    /* Check all types of shared folders and compose a single list */
     
    47764776    {
    47774777        rc = mMachine->COMGETTER(StateFilePath) (savedStateFile.asOutParam());
    4778         CheckComRCReturnRC (rc);
     4778        CheckComRCReturnRC(rc);
    47794779        ComAssertRet (!!savedStateFile, E_FAIL);
    47804780        int vrc = SSMR3ValidateFile (Utf8Str (savedStateFile), false /* fChecksumIt */);
     
    47874787
    47884788    /* create a progress object to track progress of this operation */
    4789     ComObjPtr <Progress> powerupProgress;
     4789    ComObjPtr<Progress> powerupProgress;
    47904790    powerupProgress.createObject();
    47914791    Bstr progressDesc;
     
    47964796    rc = powerupProgress->init (static_cast <IConsole *> (this),
    47974797                                progressDesc, FALSE /* aCancelable */);
    4798     CheckComRCReturnRC (rc);
     4798    CheckComRCReturnRC(rc);
    47994799
    48004800    /* setup task object and thread to carry out the operation
     
    48134813    /* Reset differencing hard disks for which autoReset is true */
    48144814    {
    4815         com::SafeIfaceArray <IHardDiskAttachment> atts;
     4815        com::SafeIfaceArray<IHardDiskAttachment> atts;
    48164816        rc = mMachine->
    48174817            COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts));
    4818         CheckComRCReturnRC (rc);
     4818        CheckComRCReturnRC(rc);
    48194819
    48204820        for (size_t i = 0; i < atts.size(); ++ i)
    48214821        {
    4822             ComPtr <IHardDisk> hardDisk;
     4822            ComPtr<IHardDisk> hardDisk;
    48234823            rc = atts [i]->COMGETTER(HardDisk) (hardDisk.asOutParam());
    4824             CheckComRCReturnRC (rc);
     4824            CheckComRCReturnRC(rc);
    48254825
    48264826            /* save for later use on the powerup thread */
     
    48304830            BOOL autoReset = FALSE;
    48314831            rc = hardDisk->COMGETTER(AutoReset)(&autoReset);
    4832             CheckComRCReturnRC (rc);
     4832            CheckComRCReturnRC(rc);
    48334833
    48344834            if (autoReset)
    48354835            {
    4836                 ComPtr <IProgress> resetProgress;
     4836                ComPtr<IProgress> resetProgress;
    48374837                rc = hardDisk->Reset (resetProgress.asOutParam());
    4838                 CheckComRCReturnRC (rc);
     4838                CheckComRCReturnRC(rc);
    48394839
    48404840                /* save for later use on the powerup thread */
     
    48454845
    48464846    rc = consoleInitReleaseLog (mMachine);
    4847     CheckComRCReturnRC (rc);
     4847    CheckComRCReturnRC(rc);
    48484848
    48494849    /* pass the progress object to the caller if requested */
     
    48544854            /* there are no other operations to track, return the powerup
    48554855             * progress only */
    4856             powerupProgress.queryInterfaceTo (aProgress);
     4856            powerupProgress.queryInterfaceTo(aProgress);
    48574857        }
    48584858        else
    48594859        {
    48604860            /* create a combined progress object */
    4861             ComObjPtr <CombinedProgress> progress;
     4861            ComObjPtr<CombinedProgress> progress;
    48624862            progress.createObject();
    48634863            VMPowerUpTask::ProgressList progresses (task->hardDiskProgresses);
    4864             progresses.push_back (ComPtr <IProgress> (powerupProgress));
     4864            progresses.push_back (ComPtr<IProgress> (powerupProgress));
    48654865            rc = progress->init (static_cast <IConsole *> (this),
    48664866                                 progressDesc, progresses.begin(),
    48674867                                 progresses.end());
    4868             AssertComRCReturnRC (rc);
    4869             progress.queryInterfaceTo (aProgress);
     4868            AssertComRCReturnRC(rc);
     4869            progress.queryInterfaceTo(aProgress);
    48704870        }
    48714871    }
     
    48894889        setMachineState (MachineState_Starting);
    48904890
    4891     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
     4891    LogFlowThisFunc(("mMachineState=%d\n", mMachineState));
    48924892    LogFlowThisFuncLeave();
    48934893    return S_OK;
     
    49264926    LogFlowThisFuncEnter();
    49274927
    4928     AutoCaller autoCaller (this);
    4929     AssertComRCReturnRC (autoCaller.rc());
    4930 
    4931     AutoWriteLock alock (this);
     4928    AutoCaller autoCaller(this);
     4929    AssertComRCReturnRC(autoCaller.rc());
     4930
     4931    AutoWriteLock alock(this);
    49324932
    49334933    /* Total # of steps for the progress object. Must correspond to the
     
    49874987    if (mConsoleVRDPServer)
    49884988    {
    4989         LogFlowThisFunc (("Stopping VRDP server...\n"));
     4989        LogFlowThisFunc(("Stopping VRDP server...\n"));
    49904990
    49914991        /* Leave the lock since EMT will call us back as addVMCaller()
     
    50075007
    50085008    /* Save all guest property store entries to the machine XML file */
    5009     com::SafeArray <BSTR> namesOut;
    5010     com::SafeArray <BSTR> valuesOut;
    5011     com::SafeArray <ULONG64> timestampsOut;
    5012     com::SafeArray <BSTR> flagsOut;
     5009    com::SafeArray<BSTR> namesOut;
     5010    com::SafeArray<BSTR> valuesOut;
     5011    com::SafeArray<ULONG64> timestampsOut;
     5012    com::SafeArray<BSTR> flagsOut;
    50135013    Bstr pattern("");
    50145014    if (pattern.isNull())
     
    50415041                }
    50425042            }
    5043             com::SafeArray <BSTR> namesIn (names);
    5044             com::SafeArray <BSTR> valuesIn (values);
    5045             com::SafeArray <ULONG64> timestampsIn (timestamps);
    5046             com::SafeArray <BSTR> flagsIn (flags);
     5043            com::SafeArray<BSTR> namesIn (names);
     5044            com::SafeArray<BSTR> valuesIn (values);
     5045            com::SafeArray<ULONG64> timestampsIn (timestamps);
     5046            com::SafeArray<BSTR> flagsIn (flags);
    50475047            if (   namesIn.isNull()
    50485048                || valuesIn.isNull()
     
    50755075    if (mVMMDev)
    50765076    {
    5077         LogFlowThisFunc (("Shutdown HGCM...\n"));
     5077        LogFlowThisFunc(("Shutdown HGCM...\n"));
    50785078
    50795079        /* Leave the lock since EMT will call us back as addVMCaller() */
     
    51065106            RTSemEventCreate (&mVMZeroCallersSem);
    51075107
    5108         LogFlowThisFunc (("Waiting for mpVM callers (%d) to drop to zero...\n",
     5108        LogFlowThisFunc(("Waiting for mpVM callers (%d) to drop to zero...\n",
    51095109                          mVMCallers));
    51105110
     
    51255125    if (!mVMPoweredOff)
    51265126    {
    5127         LogFlowThisFunc (("Powering off the VM...\n"));
     5127        LogFlowThisFunc(("Powering off the VM...\n"));
    51285128
    51295129        /* Leave the lock since EMT will call us back on VMR3PowerOff() */
     
    51495149        aProgress->setCurrentOperationProgress(99 * (++ step) / StepCount );
    51505150
    5151     LogFlowThisFunc (("Ready for VM destruction.\n"));
     5151    LogFlowThisFunc(("Ready for VM destruction.\n"));
    51525152
    51535153    /* If we are called from Console::uninit(), then try to destroy the VM even
     
    51805180        mpVM = NULL;
    51815181
    5182         LogFlowThisFunc (("Destroying the VM...\n"));
     5182        LogFlowThisFunc(("Destroying the VM...\n"));
    51835183
    51845184        alock.leave();
     
    51955195        if (VBOX_SUCCESS (vrc))
    51965196        {
    5197             LogFlowThisFunc (("Machine has been destroyed (mMachineState=%d)\n",
     5197            LogFlowThisFunc(("Machine has been destroyed (mMachineState=%d)\n",
    51985198                              mMachineState));
    51995199            /* Note: the Console-level machine state change happens on the
     
    52345234        mVMDestroying = false;
    52355235
    5236     if (SUCCEEDED (rc))
     5236    if (SUCCEEDED(rc))
    52375237    {
    52385238        /* uninit dynamically allocated members of mCallbackData */
     
    52595259                                  bool aUpdateServer /* = true */)
    52605260{
    5261     AutoCaller autoCaller (this);
    5262     AssertComRCReturnRC (autoCaller.rc());
    5263 
    5264     AutoWriteLock alock (this);
     5261    AutoCaller autoCaller(this);
     5262    AssertComRCReturnRC(autoCaller.rc());
     5263
     5264    AutoWriteLock alock(this);
    52655265
    52665266    HRESULT rc = S_OK;
     
    52685268    if (mMachineState != aMachineState)
    52695269    {
    5270         LogFlowThisFunc (("machineState=%d\n", aMachineState));
     5270        LogFlowThisFunc(("machineState=%d\n", aMachineState));
    52715271        mMachineState = aMachineState;
    52725272
     
    52785278        //      ability to synchronously react to state changes (is it really
    52795279        //      necessary??)
    5280         LogFlowThisFunc (("Doing onStateChange()...\n"));
     5280        LogFlowThisFunc(("Doing onStateChange()...\n"));
    52815281        onStateChange (aMachineState);
    5282         LogFlowThisFunc (("Done onStateChange()\n"));
     5282        LogFlowThisFunc(("Done onStateChange()\n"));
    52835283
    52845284        if (aUpdateServer)
     
    52975297             * this method).
    52985298             */
    5299             LogFlowThisFunc (("Doing mControl->UpdateState()...\n"));
     5299            LogFlowThisFunc(("Doing mControl->UpdateState()...\n"));
    53005300            rc = mControl->UpdateState (aMachineState);
    5301             LogFlowThisFunc (("mControl->UpdateState()=%08X\n", rc));
     5301            LogFlowThisFunc(("mControl->UpdateState()=%08X\n", rc));
    53025302        }
    53035303    }
     
    53205320 */
    53215321HRESULT Console::findSharedFolder (CBSTR aName,
    5322                                    ComObjPtr <SharedFolder> &aSharedFolder,
     5322                                   ComObjPtr<SharedFolder> &aSharedFolder,
    53235323                                   bool aSetError /* = false */)
    53245324{
    53255325    /* sanity check */
    5326     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     5326    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    53275327
    53285328    SharedFolderMap::const_iterator it = mSharedFolders.find (aName);
     
    53505350{
    53515351    /* sanity check */
    5352     AssertReturn (AutoCaller (this).state() == InInit ||
     5352    AssertReturn(AutoCaller (this).state() == InInit ||
    53535353                  isWriteLockOnCurrentThread(), E_FAIL);
    53545354
     
    53725372        mMachineSharedFolders.clear();
    53735373
    5374         SafeIfaceArray <ISharedFolder> folders;
     5374        SafeIfaceArray<ISharedFolder> folders;
    53755375        rc = mMachine->COMGETTER(SharedFolders) (ComSafeArrayAsOutParam(folders));
    5376         AssertComRCReturnRC (rc);
     5376        AssertComRCReturnRC(rc);
    53775377
    53785378        for (size_t i = 0; i < folders.size(); ++i)
    53795379        {
    5380             ComPtr <ISharedFolder> folder = folders[i];
     5380            ComPtr<ISharedFolder> folder = folders[i];
    53815381
    53825382            Bstr name;
     
    54235423        }
    54245424
    5425         AssertComRCReturnRC (rc);
     5425        AssertComRCReturnRC(rc);
    54265426
    54275427        /* process outdated (removed) folders */
     
    54675467{
    54685468    /* sanity check */
    5469     AssertReturn (isWriteLockOnCurrentThread(), false);
     5469    AssertReturn(isWriteLockOnCurrentThread(), false);
    54705470
    54715471    /* first, search machine folders */
     
    54975497
    54985498    /* sanity checks */
    5499     AssertReturn (mpVM, E_FAIL);
    5500     AssertReturn (mVMMDev->isShFlActive(), E_FAIL);
     5499    AssertReturn(mpVM, E_FAIL);
     5500    AssertReturn(mVMMDev->isShFlActive(), E_FAIL);
    55015501
    55025502    VBOXHGCMSVCPARM  parms[SHFL_CPARMS_ADD_MAPPING];
     
    55685568
    55695569    /* sanity checks */
    5570     AssertReturn (mpVM, E_FAIL);
    5571     AssertReturn (mVMMDev->isShFlActive(), E_FAIL);
     5570    AssertReturn(mpVM, E_FAIL);
     5571    AssertReturn(mVMMDev->isShFlActive(), E_FAIL);
    55725572
    55735573    VBOXHGCMSVCPARM  parms;
     
    56295629    AssertReturnVoid (that);
    56305630
    5631     AutoCaller autoCaller (that);
     5631    AutoCaller autoCaller(that);
    56325632
    56335633    /* Note that we must let this method proceed even if Console::uninit() has
     
    56455645        case VMSTATE_OFF:
    56465646        {
    5647             AutoWriteLock alock (that);
     5647            AutoWriteLock alock(that);
    56485648
    56495649            if (that->mVMStateChangeCallbackDisabled)
     
    57115711        case VMSTATE_TERMINATED:
    57125712        {
    5713             AutoWriteLock alock (that);
     5713            AutoWriteLock alock(that);
    57145714
    57155715            if (that->mVMStateChangeCallbackDisabled)
     
    57625762            if (aOldState == VMSTATE_RUNNING)
    57635763            {
    5764                 AutoWriteLock alock (that);
     5764                AutoWriteLock alock(that);
    57655765
    57665766                if (that->mVMStateChangeCallbackDisabled)
     
    57805780                aOldState == VMSTATE_SUSPENDED)
    57815781            {
    5782                 AutoWriteLock alock (that);
     5782                AutoWriteLock alock(that);
    57835783
    57845784                if (that->mVMStateChangeCallbackDisabled)
     
    58025802        case VMSTATE_GURU_MEDITATION:
    58035803        {
    5804             AutoWriteLock alock (that);
     5804            AutoWriteLock alock(that);
    58055805
    58065806            if (that->mVMStateChangeCallbackDisabled)
     
    58345834HRESULT Console::attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs)
    58355835{
    5836     AssertReturn (aHostDevice, E_FAIL);
    5837     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     5836    AssertReturn(aHostDevice, E_FAIL);
     5837    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    58385838
    58395839    /* still want a lock object because we need to leave it */
    5840     AutoWriteLock alock (this);
     5840    AutoWriteLock alock(this);
    58415841
    58425842    HRESULT hrc;
     
    58635863    /* protect mpVM */
    58645864    AutoVMCaller autoVMCaller (this);
    5865     CheckComRCReturnRC (autoVMCaller.rc());
    5866 
    5867     LogFlowThisFunc (("Proxying USB device '%s' {%RTuuid}...\n",
     5865    CheckComRCReturnRC(autoVMCaller.rc());
     5866
     5867    LogFlowThisFunc(("Proxying USB device '%s' {%RTuuid}...\n",
    58685868                      Address.raw(), uuid.ptr()));
    58695869
     
    58865886    if (VBOX_FAILURE (vrc))
    58875887    {
    5888         LogWarningThisFunc (("Failed to create proxy device for '%s' {%RTuuid} (%Rrc)\n",
     5888        LogWarningThisFunc(("Failed to create proxy device for '%s' {%RTuuid} (%Rrc)\n",
    58895889                             Address.raw(), uuid.ptr(), vrc));
    58905890
     
    59255925    LogFlowFunc (("that={%p}\n", that));
    59265926
    5927     AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
     5927    AssertReturn(that && aUuid, VERR_INVALID_PARAMETER);
    59285928
    59295929    void *pvRemoteBackend = NULL;
     
    59485948    {
    59495949        /* Create a OUSBDevice and add it to the device list */
    5950         ComObjPtr <OUSBDevice> device;
     5950        ComObjPtr<OUSBDevice> device;
    59515951        device.createObject();
    59525952        HRESULT hrc = device->init (aHostDevice);
    59535953        AssertComRC (hrc);
    59545954
    5955         AutoWriteLock alock (that);
     5955        AutoWriteLock alock(that);
    59565956        that->mUSBDevices.push_back (device);
    59575957        LogFlowFunc (("Attached device {%RTuuid}\n", device->id().raw()));
     
    59785978HRESULT Console::detachUSBDevice (USBDeviceList::iterator &aIt)
    59795979{
    5980     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     5980    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    59815981
    59825982    /* still want a lock object because we need to leave it */
    5983     AutoWriteLock alock (this);
     5983    AutoWriteLock alock(this);
    59845984
    59855985    /* protect mpVM */
    59865986    AutoVMCaller autoVMCaller (this);
    5987     CheckComRCReturnRC (autoVMCaller.rc());
     5987    CheckComRCReturnRC(autoVMCaller.rc());
    59885988
    59895989    /* if the device is attached, then there must at least one USB hub. */
    5990     AssertReturn (PDMR3USBHasHub (mpVM), E_FAIL);
    5991 
    5992     LogFlowThisFunc (("Detaching USB proxy device {%RTuuid}...\n",
     5990    AssertReturn(PDMR3USBHasHub (mpVM), E_FAIL);
     5991
     5992    LogFlowThisFunc(("Detaching USB proxy device {%RTuuid}...\n",
    59935993                      (*aIt)->id().raw()));
    59945994
     
    60266026    LogFlowFunc (("that={%p}\n", that));
    60276027
    6028     AssertReturn (that && aUuid, VERR_INVALID_PARAMETER);
    6029     ComObjPtr <OUSBDevice> device = **aIt;
     6028    AssertReturn(that && aUuid, VERR_INVALID_PARAMETER);
     6029    ComObjPtr<OUSBDevice> device = **aIt;
    60306030
    60316031    /*
     
    60486048    if (VBOX_SUCCESS (vrc))
    60496049    {
    6050         AutoWriteLock alock (that);
     6050        AutoWriteLock alock(that);
    60516051
    60526052        /* Remove the device from the collection */
     
    60906090    LogFlowThisFunc(("\n"));
    60916091    /* sanity check */
    6092     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     6092    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    60936093
    60946094# ifdef VBOX_STRICT
     
    62186218    /* sanity check */
    62196219    LogFlowThisFunc(("\n"));
    6220     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     6220    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    62216221
    62226222    HRESULT rc = S_OK;
     
    62756275HRESULT Console::powerDownHostInterfaces()
    62766276{
    6277     LogFlowThisFunc (("\n"));
     6277    LogFlowThisFunc(("\n"));
    62786278
    62796279    /* sanity check */
    6280     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     6280    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    62816281
    62826282    /*
     
    63216321{
    63226322    VMProgressTask *task = static_cast <VMProgressTask *> (pvUser);
    6323     AssertReturn (task, VERR_INVALID_PARAMETER);
     6323    AssertReturn(task, VERR_INVALID_PARAMETER);
    63246324
    63256325    /* update the progress object */
     
    64116411HRESULT Console::captureUSBDevices (PVM pVM)
    64126412{
    6413     LogFlowThisFunc (("\n"));
     6413    LogFlowThisFunc(("\n"));
    64146414
    64156415    /* sanity check */
     
    64256425         * us back from under its lock (e.g. onUSBDeviceAttach()) which would
    64266426         * produce an inter-process dead-lock otherwise. */
    6427         AutoWriteLock alock (this);
     6427        AutoWriteLock alock(this);
    64286428        alock.leave();
    64296429
     
    64496449void Console::detachAllUSBDevices (bool aDone)
    64506450{
    6451     LogFlowThisFunc (("aDone=%RTbool\n", aDone));
     6451    LogFlowThisFunc(("aDone=%RTbool\n", aDone));
    64526452
    64536453    /* sanity check */
     
    64596459     * us back from under its lock (e.g. onUSBDeviceAttach()) which would
    64606460     * produce an inter-process dead-lock otherwise. */
    6461     AutoWriteLock alock (this);
     6461    AutoWriteLock alock(this);
    64626462    alock.leave();
    64636463
     
    64716471{
    64726472    LogFlowThisFuncEnter();
    6473     LogFlowThisFunc (("u32ClientId = %d, pDevList=%p, cbDevList = %d\n", u32ClientId, pDevList, cbDevList));
    6474 
    6475     AutoCaller autoCaller (this);
     6473    LogFlowThisFunc(("u32ClientId = %d, pDevList=%p, cbDevList = %d\n", u32ClientId, pDevList, cbDevList));
     6474
     6475    AutoCaller autoCaller(this);
    64766476    if (!autoCaller.isOk())
    64776477    {
     
    64796479        AssertMsgFailed (("Temporary assertion to prove that it happens, "
    64806480                          "please report to dmik\n"));
    6481         LogFlowThisFunc (("Console is already uninitialized\n"));
     6481        LogFlowThisFunc(("Console is already uninitialized\n"));
    64826482        LogFlowThisFuncLeave();
    64836483        return;
    64846484    }
    64856485
    6486     AutoWriteLock alock (this);
     6486    AutoWriteLock alock(this);
    64876487
    64886488    /*
     
    65076507    while (cbDevList >= 2 && e->oNext)
    65086508    {
    6509         LogFlowThisFunc (("vendor %04X, product %04X, name = %s\n",
     6509        LogFlowThisFunc(("vendor %04X, product %04X, name = %s\n",
    65106510                          e->idVendor, e->idProduct,
    65116511                          e->oProduct? (char *)e + e->oProduct: ""));
     
    65356535
    65366536            /* Create the device object and add the new device to list. */
    6537             ComObjPtr <RemoteUSBDevice> device;
     6537            ComObjPtr<RemoteUSBDevice> device;
    65386538            device.createObject();
    65396539            device->init (u32ClientId, e);
     
    65496549            AssertComRC (hrc);
    65506550
    6551             LogFlowThisFunc (("USB filters return %d %#x\n", fMatched, fMaskedIfs));
     6551            LogFlowThisFunc(("USB filters return %d %#x\n", fMatched, fMaskedIfs));
    65526552
    65536553            if (fMatched)
     
    65596559                if (hrc == S_OK)
    65606560                {
    6561                     LogFlowThisFunc (("Device attached\n"));
     6561                    LogFlowThisFunc(("Device attached\n"));
    65626562                    device->captured (true);
    65636563                }
     
    65676567        if (cbDevList < e->oNext)
    65686568        {
    6569             LogWarningThisFunc (("cbDevList %d > oNext %d\n",
     6569            LogWarningThisFunc(("cbDevList %d > oNext %d\n",
    65706570                                 cbDevList, e->oNext));
    65716571            break;
     
    65826582    for (;;)
    65836583    {
    6584         ComObjPtr <RemoteUSBDevice> device;
     6584        ComObjPtr<RemoteUSBDevice> device;
    65856585
    65866586        RemoteUSBDeviceList::iterator it = mRemoteUSBDevices.begin();
     
    66456645
    66466646    std::auto_ptr <VMPowerUpTask> task (static_cast <VMPowerUpTask *> (pvUser));
    6647     AssertReturn (task.get(), VERR_INVALID_PARAMETER);
    6648 
    6649     AssertReturn (!task->mConsole.isNull(), VERR_INVALID_PARAMETER);
    6650     AssertReturn (!task->mProgress.isNull(), VERR_INVALID_PARAMETER);
     6647    AssertReturn(task.get(), VERR_INVALID_PARAMETER);
     6648
     6649    AssertReturn(!task->mConsole.isNull(), VERR_INVALID_PARAMETER);
     6650    AssertReturn(!task->mProgress.isNull(), VERR_INVALID_PARAMETER);
    66516651
    66526652#if defined(RT_OS_WINDOWS)
     
    66696669                "BU", "IL", "DI", "D", VBOX_VERSION_STRING, VBoxSVNRev (), "BU", "IL", "DI", "D");
    66706670
    6671     ComObjPtr <Console> console = task->mConsole;
     6671    ComObjPtr<Console> console = task->mConsole;
    66726672
    66736673    /* Note: no need to use addCaller() because VMPowerUpTask does that */
     
    66756675    /* The lock is also used as a signal from the task initiator (which
    66766676     * releases it only after RTThreadCreate()) that we can start the job */
    6677     AutoWriteLock alock (console);
     6677    AutoWriteLock alock(console);
    66786678
    66796679    /* sanity */
     
    67426742#endif /* VBOX_WITH_VRDP */
    67436743
    6744         ComPtr <IMachine> pMachine = console->machine();
     6744        ComPtr<IMachine> pMachine = console->machine();
    67456745        ULONG cCpus = 1;
    67466746        pMachine->COMGETTER(CPUCount)(&cCpus);
     
    69086908        }
    69096909
    6910         if (SUCCEEDED (rc) && VBOX_FAILURE (vrc))
     6910        if (SUCCEEDED(rc) && VBOX_FAILURE (vrc))
    69116911        {
    69126912            /* If VMR3Create() or one of the other calls in this function fail,
     
    69646964    alock.leave();
    69656965
    6966     if (SUCCEEDED (rc))
     6966    if (SUCCEEDED(rc))
    69676967    {
    69686968        /* Notify the progress object of the success */
     
    71537153    /* Pass all custom parameters. */
    71547154    bool fHostIP = true;
    7155     SafeArray <BSTR> names;
    7156     SafeArray <BSTR> values;
     7155    SafeArray<BSTR> names;
     7156    SafeArray<BSTR> values;
    71577157    hrc = hardDisk->GetProperties (NULL,
    71587158                                   ComSafeArrayAsOutParam (names),
     
    71947194
    71957195        /* Pass all custom parameters. */
    7196         SafeArray <BSTR> names;
    7197         SafeArray <BSTR> values;
     7196        SafeArray<BSTR> names;
     7197        SafeArray<BSTR> values;
    71987198        hrc = hardDisk->GetProperties (NULL,
    71997199                                       ComSafeArrayAsOutParam (names),
     
    72597259
    72607260    std::auto_ptr <VMSaveTask> task (static_cast <VMSaveTask *> (pvUser));
    7261     AssertReturn (task.get(), VERR_INVALID_PARAMETER);
     7261    AssertReturn(task.get(), VERR_INVALID_PARAMETER);
    72627262
    72637263    Assert(task->mSavedStateFile.length());
    72647264    Assert(!task->mProgress.isNull());
    72657265
    7266     const ComObjPtr <Console> &that = task->mConsole;
     7266    const ComObjPtr<Console> &that = task->mConsole;
    72677267
    72687268    /*
     
    72807280
    72817281        rc = task->mServerProgress->WaitForCompletion (-1);
    7282         if (SUCCEEDED (rc))
     7282        if (SUCCEEDED(rc))
    72837283        {
    72847284            LONG iRc = S_OK;
    72857285            rc = task->mServerProgress->COMGETTER(ResultCode) (&iRc);
    7286             if (SUCCEEDED (rc))
     7286            if (SUCCEEDED(rc))
    72877287                rc = iRc;
    72887288        }
    72897289    }
    72907290
    7291     if (SUCCEEDED (rc))
     7291    if (SUCCEEDED(rc))
    72927292    {
    72937293        LogFlowFunc (("Saving the state to '%s'...\n", task->mSavedStateFile.raw()));
     
    73087308    AutoWriteLock thatLock (that);
    73097309
    7310     if (SUCCEEDED (rc))
     7310    if (SUCCEEDED(rc))
    73117311    {
    73127312        if (task->mIsSnapshot)
     
    73157315            LogFlowFunc (("Reattaching new differencing hard disks...\n"));
    73167316
    7317             com::SafeIfaceArray <IHardDiskAttachment> atts;
     7317            com::SafeIfaceArray<IHardDiskAttachment> atts;
    73187318            rc = that->mMachine->
    73197319                COMGETTER(HardDiskAttachments) (ComSafeArrayAsOutParam (atts));
     
    73747374         *  before calling mControl->BeginTakingSnapshot().
    73757375         */
    7376         that->mControl->EndTakingSnapshot (SUCCEEDED (rc));
     7376        that->mControl->EndTakingSnapshot (SUCCEEDED(rc));
    73777377    }
    73787378    else
     
    73847384         *  before calling mControl->BeginSavingState().
    73857385         */
    7386         that->mControl->EndSavingState (SUCCEEDED (rc));
     7386        that->mControl->EndSavingState (SUCCEEDED(rc));
    73877387    }
    73887388
     
    74147414
    74157415    /* notify the progress object about operation completion */
    7416     if (SUCCEEDED (rc))
     7416    if (SUCCEEDED(rc))
    74177417        task->mProgress->notifyComplete (S_OK);
    74187418    else
     
    74467446
    74477447    std::auto_ptr <VMProgressTask> task (static_cast <VMProgressTask *> (pvUser));
    7448     AssertReturn (task.get(), VERR_INVALID_PARAMETER);
    7449 
    7450     AssertReturn (task->isOk(), VERR_GENERAL_FAILURE);
    7451 
    7452     const ComObjPtr <Console> &that = task->mConsole;
     7448    AssertReturn(task.get(), VERR_INVALID_PARAMETER);
     7449
     7450    AssertReturn(task->isOk(), VERR_GENERAL_FAILURE);
     7451
     7452    const ComObjPtr<Console> &that = task->mConsole;
    74537453
    74547454    /* Note: no need to use addCaller() to protect Console because VMTask does
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r21817 r21878  
    152152#endif
    153153
    154     AssertReturn (pvConsole, VERR_GENERAL_FAILURE);
    155     ComObjPtr <Console> pConsole = static_cast <Console *> (pvConsole);
    156 
    157     AutoCaller autoCaller (pConsole);
     154    AssertReturn(pvConsole, VERR_GENERAL_FAILURE);
     155    ComObjPtr<Console> pConsole = static_cast <Console *> (pvConsole);
     156
     157    AutoCaller autoCaller(pConsole);
    158158    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    159159
    160160    /* lock the console because we widely use internal fields and methods */
    161     AutoWriteLock alock (pConsole);
     161    AutoWriteLock alock(pConsole);
    162162
    163163    /* Save the VM pointer in the machine object */
    164164    pConsole->mpVM = pVM;
    165165
    166     ComPtr <IMachine> pMachine = pConsole->machine();
     166    ComPtr<IMachine> pMachine = pConsole->machine();
    167167
    168168    int             rc;
     
    188188    hrc = virtualBox->COMGETTER(Host)(host.asOutParam());                           H();
    189189
    190     ComPtr <ISystemProperties> systemProperties;
     190    ComPtr<ISystemProperties> systemProperties;
    191191    hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());   H();
    192192
     
    268268        hrc = pMachine->COMGETTER(OSTypeId)(osTypeId.asOutParam());                 H();
    269269
    270         ComPtr <IGuestOSType> guestOSType;
     270        ComPtr<IGuestOSType> guestOSType;
    271271        hrc = virtualBox->GetGuestOSType(osTypeId, guestOSType.asOutParam());       H();
    272272
     
    11051105            /* Pass all custom parameters. */
    11061106            bool fHostIP = true;
    1107             SafeArray <BSTR> names;
    1108             SafeArray <BSTR> values;
     1107            SafeArray<BSTR> names;
     1108            SafeArray<BSTR> values;
    11091109            hrc = hardDisk->GetProperties (NULL,
    11101110                                           ComSafeArrayAsOutParam (names),
     
    11471147
    11481148                /* Pass all custom parameters. */
    1149                 SafeArray <BSTR> names;
    1150                 SafeArray <BSTR> values;
     1149                SafeArray<BSTR> names;
     1150                SafeArray<BSTR> values;
    11511151                hrc = hardDisk->GetProperties (NULL,
    11521152                                                ComSafeArrayAsOutParam (names),
     
    17021702            rc = pConsole->mVMMDev->hgcmLoadService ("VBoxSharedClipboard", "VBoxSharedClipboard");
    17031703
    1704             if (RT_FAILURE (rc))
     1704            if (RT_FAILURE(rc))
    17051705            {
    17061706                LogRel(("VBoxSharedClipboard is not available. rc = %Rrc\n", rc));
     
    18011801        rc = pConsole->mVMMDev->hgcmLoadService ("VBoxGuestPropSvc", "VBoxGuestPropSvc");
    18021802
    1803         if (RT_FAILURE (rc))
     1803        if (RT_FAILURE(rc))
    18041804        {
    18051805            LogRel(("VBoxGuestPropSvc is not available. rc = %Rrc\n", rc));
     
    20182018    int rc2 = VMR3AtStateRegister (pVM, Console::vmstateChangeCallback, pConsole);
    20192019    AssertRC (rc2);
    2020     if (RT_SUCCESS (rc))
     2020    if (RT_SUCCESS(rc))
    20212021        rc = rc2;
    20222022
     
    20242024    rc2 = VMR3AtRuntimeErrorRegister (pVM, Console::setVMRuntimeErrorCallback, pConsole);
    20252025    AssertRC (rc2);
    2026     if (RT_SUCCESS (rc))
     2026    if (RT_SUCCESS(rc))
    20272027        rc = rc2;
    20282028
     
    20562056    int rcRet = VINF_SUCCESS;
    20572057
    2058     AutoCaller autoCaller (pThis);
     2058    AutoCaller autoCaller(pThis);
    20592059    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    20602060
     
    20642064     * meAttachmentType member.
    20652065     */
    2066     AutoWriteLock alock (pThis);
     2066    AutoWriteLock alock(pThis);
    20672067
    20682068    PVM pVM = pThis->mpVM;
     
    20752075    {
    20762076        HRESULT hrc;
    2077         ComPtr <IMachine> pMachine = pThis->machine();
     2077        ComPtr<IMachine> pMachine = pThis->machine();
    20782078
    20792079        ComPtr<IVirtualBox> virtualBox;
  • trunk/src/VBox/Main/ConsoleVRDPServer.cpp

    r21726 r21878  
    11121112    AssertComRC(rc2);
    11131113
    1114     if (SUCCEEDED (rc2) && vrdpEnabled)
     1114    if (SUCCEEDED(rc2) && vrdpEnabled)
    11151115    {
    11161116        if (loadVRDPLibrary ())
     
    12791279    int rc = RTSemEventCreate (&mUSBBackends.event);
    12801280
    1281     if (RT_FAILURE (rc))
     1281    if (RT_FAILURE(rc))
    12821282    {
    12831283        AssertFailed ();
     
    12851285    }
    12861286
    1287     if (RT_SUCCESS (rc))
     1287    if (RT_SUCCESS(rc))
    12881288    {
    12891289        rc = RTThreadCreate (&mUSBBackends.thread, threadRemoteUSB, this, 65536,
     
    12911291    }
    12921292
    1293     if (RT_FAILURE (rc))
     1293    if (RT_FAILURE(rc))
    12941294    {
    12951295        LogRel(("Warning: could not start the remote USB thread, rc = %Rrc!!!\n", rc));
     
    13011301        rc = RTThreadUserWait (mUSBBackends.thread, 60000);
    13021302        AssertRC (rc);
    1303         Assert (mUSBBackends.fThreadRunning || RT_FAILURE (rc));
     1303        Assert (mUSBBackends.fThreadRunning || RT_FAILURE(rc));
    13041304    }
    13051305}
     
    13651365
    13661366        int rc = RTLdrLoad (filename.raw(), &mAuthLibrary);
    1367         if (RT_FAILURE (rc))
     1367        if (RT_FAILURE(rc))
    13681368            LogRel(("VRDPAUTH: Failed to load external authentication library. Error code: %Rrc\n", rc));
    13691369
    1370         if (RT_SUCCESS (rc))
     1370        if (RT_SUCCESS(rc))
    13711371        {
    13721372            /* Get the entry point. */
    13731373            mpfnAuthEntry2 = NULL;
    13741374            int rc2 = RTLdrGetSymbol(mAuthLibrary, "VRDPAuth2", (void**)&mpfnAuthEntry2);
    1375             if (RT_FAILURE (rc2))
     1375            if (RT_FAILURE(rc2))
    13761376            {
    13771377                if (rc2 != VERR_SYMBOL_NOT_FOUND)
     
    13851385            mpfnAuthEntry = NULL;
    13861386            rc2 = RTLdrGetSymbol(mAuthLibrary, "VRDPAuth", (void**)&mpfnAuthEntry);
    1387             if (RT_FAILURE (rc2))
     1387            if (RT_FAILURE(rc2))
    13881388            {
    13891389                if (rc2 != VERR_SYMBOL_NOT_FOUND)
     
    14011401        }
    14021402
    1403         if (RT_FAILURE (rc))
     1403        if (RT_FAILURE(rc))
    14041404        {
    14051405            mConsole->reportAuthLibraryError (filename.raw(), rc);
     
    15971597    int rc = lockConsoleVRDPServer ();
    15981598
    1599     if (RT_SUCCESS (rc))
     1599    if (RT_SUCCESS(rc))
    16001600    {
    16011601        if (mcClipboardRefs == 0)
     
    16031603            rc = HGCMHostRegisterServiceExtension (&mhClipboard, "VBoxSharedClipboard", ClipboardServiceExtension, this);
    16041604
    1605             if (RT_SUCCESS (rc))
     1605            if (RT_SUCCESS(rc))
    16061606            {
    16071607                mcClipboardRefs++;
     
    16171617    int rc = lockConsoleVRDPServer ();
    16181618
    1619     if (RT_SUCCESS (rc))
     1619    if (RT_SUCCESS(rc))
    16201620    {
    16211621        mcClipboardRefs--;
     
    16481648        int rc = lockConsoleVRDPServer ();
    16491649
    1650         if (RT_SUCCESS (rc))
     1650        if (RT_SUCCESS(rc))
    16511651        {
    16521652            pRemoteUSBBackend->pNext = mUSBBackends.pHead;
     
    16701670        }
    16711671
    1672         if (RT_FAILURE (rc))
     1672        if (RT_FAILURE(rc))
    16731673        {
    16741674            pRemoteUSBBackend->Release ();
     
    16881688    int rc = lockConsoleVRDPServer ();
    16891689
    1690     if (RT_SUCCESS (rc))
     1690    if (RT_SUCCESS(rc))
    16911691    {
    16921692        pRemoteUSBBackend = usbBackendFind (u32ClientId);
     
    17171717    int rc = lockConsoleVRDPServer ();
    17181718
    1719     if (RT_SUCCESS (rc))
     1719    if (RT_SUCCESS(rc))
    17201720    {
    17211721        pRemoteUSBBackend = usbBackendFind (u32ClientId);
     
    17571757    int rc = lockConsoleVRDPServer ();
    17581758
    1759     if (RT_SUCCESS (rc))
     1759    if (RT_SUCCESS(rc))
    17601760    {
    17611761        pRemoteUSBBackend = usbBackendFindByUUID (pGuid);
     
    17851785    int rc = lockConsoleVRDPServer ();
    17861786
    1787     if (RT_SUCCESS (rc))
     1787    if (RT_SUCCESS(rc))
    17881788    {
    17891789        if (pRemoteUSBBackend == NULL)
     
    20492049HRESULT RemoteDisplayInfo::init (Console *aParent)
    20502050{
    2051     LogFlowThisFunc (("aParent=%p\n", aParent));
     2051    LogFlowThisFunc(("aParent=%p\n", aParent));
    20522052
    20532053    ComAssertRet (aParent, E_INVALIDARG);
    20542054
    20552055    /* Enclose the state transition NotReady->InInit->Ready */
    2056     AutoInitSpan autoInitSpan (this);
    2057     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    2058 
    2059     unconst (mParent) = aParent;
     2056    AutoInitSpan autoInitSpan(this);
     2057    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     2058
     2059    unconst(mParent) = aParent;
    20602060
    20612061    /* Confirm a successful initialization */
     
    20712071void RemoteDisplayInfo::uninit()
    20722072{
    2073     LogFlowThisFunc (("\n"));
     2073    LogFlowThisFunc(("\n"));
    20742074
    20752075    /* Enclose the state transition Ready->InUninit->NotReady */
    2076     AutoUninitSpan autoUninitSpan (this);
     2076    AutoUninitSpan autoUninitSpan(this);
    20772077    if (autoUninitSpan.uninitDone())
    20782078        return;
    20792079
    2080     unconst (mParent).setNull();
     2080    unconst(mParent).setNull();
    20812081}
    20822082
     
    20902090            return E_POINTER;                                             \
    20912091                                                                          \
    2092         AutoCaller autoCaller (this);                                     \
    2093         CheckComRCReturnRC (autoCaller.rc());                             \
     2092        AutoCaller autoCaller(this);                                     \
     2093        CheckComRCReturnRC(autoCaller.rc());                             \
    20942094                                                                          \
    20952095        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    2096         AutoWriteLock alock (this);                                       \
     2096        AutoWriteLock alock(this);                                       \
    20972097                                                                          \
    20982098        uint32_t value;                                                   \
     
    21132113            return E_POINTER;                                             \
    21142114                                                                          \
    2115         AutoCaller autoCaller (this);                                     \
    2116         CheckComRCReturnRC (autoCaller.rc());                             \
     2115        AutoCaller autoCaller(this);                                     \
     2116        CheckComRCReturnRC(autoCaller.rc());                             \
    21172117                                                                          \
    21182118        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    2119         AutoWriteLock alock (this);                                       \
     2119        AutoWriteLock alock(this);                                       \
    21202120                                                                          \
    21212121        _aType value;                                                     \
     
    21362136            return E_POINTER;                                             \
    21372137                                                                          \
    2138         AutoCaller autoCaller (this);                                     \
    2139         CheckComRCReturnRC (autoCaller.rc());                             \
     2138        AutoCaller autoCaller(this);                                     \
     2139        CheckComRCReturnRC(autoCaller.rc());                             \
    21402140                                                                          \
    21412141        /* todo: Not sure if a AutoReadLock would be sufficient. */       \
    2142         AutoWriteLock alock (this);                                       \
     2142        AutoWriteLock alock(this);                                       \
    21432143                                                                          \
    21442144        uint32_t cbOut = 0;                                               \
     
    21502150        {                                                                 \
    21512151            Bstr str("");                                                 \
    2152             str.cloneTo (a##_aName);                                      \
     2152            str.cloneTo(a##_aName);                                      \
    21532153            return S_OK;                                                  \
    21542154        }                                                                 \
     
    21692169        Bstr str(pchBuffer);                                              \
    21702170                                                                          \
    2171         str.cloneTo (a##_aName);                                          \
     2171        str.cloneTo(a##_aName);                                          \
    21722172                                                                          \
    21732173        RTMemTmpFree (pchBuffer);                                         \
  • trunk/src/VBox/Main/DHCPServerImpl.cpp

    r21860 r21878  
    4646{
    4747    /* Enclose the state transition Ready->InUninit->NotReady */
    48     AutoUninitSpan autoUninitSpan (this);
     48    AutoUninitSpan autoUninitSpan(this);
    4949    if (autoUninitSpan.uninitDone())
    5050        return;
     
    5656    mVirtualBox->removeDependentChild (this);
    5757
    58     unconst (mVirtualBox).setNull();
     58    unconst(mVirtualBox).setNull();
    5959}
    6060
    6161HRESULT DHCPServer::init(VirtualBox *aVirtualBox, IN_BSTR aName)
    6262{
    63     AssertReturn (aName != NULL, E_INVALIDARG);
    64 
    65     AutoInitSpan autoInitSpan (this);
    66     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     63    AssertReturn(aName != NULL, E_INVALIDARG);
     64
     65    AutoInitSpan autoInitSpan(this);
     66    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6767
    6868    /* share VirtualBox weakly (parent remains NULL so far) */
    69     unconst (mVirtualBox) = aVirtualBox;
     69    unconst(mVirtualBox) = aVirtualBox;
    7070
    7171    unconst(mName) = aName;
     
    9191
    9292    /* Enclose the state transition NotReady->InInit->Ready */
    93     AutoInitSpan autoInitSpan (this);
    94     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     93    AutoInitSpan autoInitSpan(this);
     94    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    9595
    9696    /* share VirtualBox weakly (parent remains NULL so far) */
    97     unconst (mVirtualBox) = aVirtualBox;
     97    unconst(mVirtualBox) = aVirtualBox;
    9898
    9999    aVirtualBox->addDependentChild (this);
     
    115115    using namespace settings;
    116116
    117     AssertReturn (!aParentNode.isNull(), E_FAIL);
    118 
    119     AutoCaller autoCaller (this);
    120     CheckComRCReturnRC (autoCaller.rc());
    121 
    122     AutoReadLock alock (this);
     117    AssertReturn(!aParentNode.isNull(), E_FAIL);
     118
     119    AutoCaller autoCaller(this);
     120    CheckComRCReturnRC(autoCaller.rc());
     121
     122    AutoReadLock alock(this);
    123123
    124124    Key aNode = aParentNode.appendKey ("DHCPServer");
     
    139139    CheckComArgOutPointerValid(aName);
    140140
    141     AutoCaller autoCaller (this);
    142     CheckComRCReturnRC (autoCaller.rc());
     141    AutoCaller autoCaller(this);
     142    CheckComRCReturnRC(autoCaller.rc());
    143143
    144144    mName.cloneTo(aName);
     
    151151    CheckComArgOutPointerValid(aEnabled);
    152152
    153     AutoCaller autoCaller (this);
    154     CheckComRCReturnRC (autoCaller.rc());
     153    AutoCaller autoCaller(this);
     154    CheckComRCReturnRC(autoCaller.rc());
    155155
    156156    *aEnabled = m.enabled;
     
    161161STDMETHODIMP DHCPServer::COMSETTER(Enabled) (BOOL aEnabled)
    162162{
    163     AutoCaller autoCaller (this);
    164     CheckComRCReturnRC (autoCaller.rc());
     163    AutoCaller autoCaller(this);
     164    CheckComRCReturnRC(autoCaller.rc());
    165165
    166166    /* VirtualBox::saveSettings() needs a write lock */
     
    178178    CheckComArgOutPointerValid(aIPAddress);
    179179
    180     AutoCaller autoCaller (this);
    181     CheckComRCReturnRC (autoCaller.rc());
     180    AutoCaller autoCaller(this);
     181    CheckComRCReturnRC(autoCaller.rc());
    182182
    183183    m.IPAddress.cloneTo(aIPAddress);
     
    190190    CheckComArgOutPointerValid(aNetworkMask);
    191191
    192     AutoCaller autoCaller (this);
    193     CheckComRCReturnRC (autoCaller.rc());
     192    AutoCaller autoCaller(this);
     193    CheckComRCReturnRC(autoCaller.rc());
    194194
    195195    m.networkMask.cloneTo(aNetworkMask);
     
    202202    CheckComArgOutPointerValid(aIPAddress);
    203203
    204     AutoCaller autoCaller (this);
    205     CheckComRCReturnRC (autoCaller.rc());
     204    AutoCaller autoCaller(this);
     205    CheckComRCReturnRC(autoCaller.rc());
    206206
    207207    m.lowerIP.cloneTo(aIPAddress);
     
    214214    CheckComArgOutPointerValid(aIPAddress);
    215215
    216     AutoCaller autoCaller (this);
    217     CheckComRCReturnRC (autoCaller.rc());
     216    AutoCaller autoCaller(this);
     217    CheckComRCReturnRC(autoCaller.rc());
    218218
    219219    m.upperIP.cloneTo(aIPAddress);
     
    224224STDMETHODIMP DHCPServer::SetConfiguration (IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aLowerIP, IN_BSTR aUpperIP)
    225225{
    226     AssertReturn (aIPAddress != NULL, E_INVALIDARG);
    227     AssertReturn (aNetworkMask != NULL, E_INVALIDARG);
    228     AssertReturn (aLowerIP != NULL, E_INVALIDARG);
    229     AssertReturn (aUpperIP != NULL, E_INVALIDARG);
    230 
    231     AutoCaller autoCaller (this);
    232     CheckComRCReturnRC (autoCaller.rc());
     226    AssertReturn(aIPAddress != NULL, E_INVALIDARG);
     227    AssertReturn(aNetworkMask != NULL, E_INVALIDARG);
     228    AssertReturn(aLowerIP != NULL, E_INVALIDARG);
     229    AssertReturn(aUpperIP != NULL, E_INVALIDARG);
     230
     231    AutoCaller autoCaller(this);
     232    CheckComRCReturnRC(autoCaller.rc());
    233233
    234234    /* VirtualBox::saveSettings() needs a write lock */
  • trunk/src/VBox/Main/DHCPServerRunner.cpp

    r21860 r21878  
    122122
    123123    int rc = RTProcCreate (exePath, args, RTENV_DEFAULT, 0, &mProcess);
    124     if (RT_FAILURE (rc))
     124    if (RT_FAILURE(rc))
    125125        mProcess = NIL_RTPROCESS;
    126126
  • trunk/src/VBox/Main/DVDDriveImpl.cpp

    r19511 r21878  
    6363HRESULT DVDDrive::init (Machine *aParent)
    6464{
    65     LogFlowThisFunc (("aParent=%p\n", aParent));
     65    LogFlowThisFunc(("aParent=%p\n", aParent));
    6666
    6767    ComAssertRet (aParent, E_INVALIDARG);
    6868
    6969    /* Enclose the state transition NotReady->InInit->Ready */
    70     AutoInitSpan autoInitSpan (this);
    71     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    72 
    73     unconst (mParent) = aParent;
     70    AutoInitSpan autoInitSpan(this);
     71    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     72
     73    unconst(mParent) = aParent;
    7474    /* mPeer is left null */
    7575
     
    9494HRESULT DVDDrive::init (Machine *aParent, DVDDrive *aThat)
    9595{
    96     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     96    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    9797
    9898    ComAssertRet (aParent && aThat, E_INVALIDARG);
    9999
    100100    /* Enclose the state transition NotReady->InInit->Ready */
    101     AutoInitSpan autoInitSpan (this);
    102     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    103 
    104     unconst (mParent) = aParent;
    105     unconst (mPeer) = aThat;
     101    AutoInitSpan autoInitSpan(this);
     102    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     103
     104    unconst(mParent) = aParent;
     105    unconst(mPeer) = aThat;
    106106
    107107    AutoCaller thatCaller (aThat);
    108     AssertComRCReturnRC (thatCaller.rc());
     108    AssertComRCReturnRC(thatCaller.rc());
    109109
    110110    AutoReadLock thatLock (aThat);
     
    126126HRESULT DVDDrive::initCopy (Machine *aParent, DVDDrive *aThat)
    127127{
    128     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     128    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    129129
    130130    ComAssertRet (aParent && aThat, E_INVALIDARG);
    131131
    132132    /* Enclose the state transition NotReady->InInit->Ready */
    133     AutoInitSpan autoInitSpan (this);
    134     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    135 
    136     unconst (mParent) = aParent;
     133    AutoInitSpan autoInitSpan(this);
     134    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     135
     136    unconst(mParent) = aParent;
    137137    /* mPeer is left null */
    138138
    139139    AutoCaller thatCaller (aThat);
    140     AssertComRCReturnRC (thatCaller.rc());
     140    AssertComRCReturnRC(thatCaller.rc());
    141141
    142142    AutoReadLock thatLock (aThat);
     
    166166void DVDDrive::uninit()
    167167{
    168     LogFlowThisFunc (("\n"));
     168    LogFlowThisFunc(("\n"));
    169169
    170170    /* Enclose the state transition Ready->InUninit->NotReady */
    171     AutoUninitSpan autoUninitSpan (this);
     171    AutoUninitSpan autoUninitSpan(this);
    172172    if (autoUninitSpan.uninitDone())
    173173        return;
     
    189189    m.free();
    190190
    191     unconst (mPeer).setNull();
    192     unconst (mParent).setNull();
     191    unconst(mPeer).setNull();
     192    unconst(mParent).setNull();
    193193}
    194194
     
    200200    CheckComArgOutPointerValid(aState);
    201201
    202     AutoCaller autoCaller (this);
    203     CheckComRCReturnRC (autoCaller.rc());
    204 
    205     AutoReadLock alock (this);
     202    AutoCaller autoCaller(this);
     203    CheckComRCReturnRC(autoCaller.rc());
     204
     205    AutoReadLock alock(this);
    206206
    207207    *aState = m->state;
     
    214214    CheckComArgOutPointerValid(aPassthrough);
    215215
    216     AutoCaller autoCaller (this);
    217     CheckComRCReturnRC (autoCaller.rc());
    218 
    219     AutoReadLock alock (this);
     216    AutoCaller autoCaller(this);
     217    CheckComRCReturnRC(autoCaller.rc());
     218
     219    AutoReadLock alock(this);
    220220
    221221    *aPassthrough = m->passthrough;
     
    226226STDMETHODIMP DVDDrive::COMSETTER(Passthrough) (BOOL aPassthrough)
    227227{
    228     AutoCaller autoCaller (this);
    229     CheckComRCReturnRC (autoCaller.rc());
     228    AutoCaller autoCaller(this);
     229    CheckComRCReturnRC(autoCaller.rc());
    230230
    231231    /* the machine needs to be mutable */
    232232    Machine::AutoMutableStateDependency adep (mParent);
    233     CheckComRCReturnRC (adep.rc());
    234 
    235     AutoWriteLock alock (this);
     233    CheckComRCReturnRC(adep.rc());
     234
     235    AutoWriteLock alock(this);
    236236
    237237    if (m->passthrough != aPassthrough)
     
    252252    CheckComArgExpr(aImageId, !imageId.isEmpty());
    253253
    254     AutoCaller autoCaller (this);
    255     CheckComRCReturnRC (autoCaller.rc());
     254    AutoCaller autoCaller(this);
     255    CheckComRCReturnRC(autoCaller.rc());
    256256
    257257    /* the machine needs to be mutable */
    258258    Machine::AutoMutableStateDependency adep (mParent);
    259     CheckComRCReturnRC (adep.rc());
    260 
    261     AutoWriteLock alock (this);
     259    CheckComRCReturnRC(adep.rc());
     260
     261    AutoWriteLock alock(this);
    262262
    263263    HRESULT rc = E_FAIL;
     
    270270                                             true /* aSetError */, &image);
    271271
    272     if (SUCCEEDED (rc))
     272    if (SUCCEEDED(rc))
    273273    {
    274274        if (m->state != DriveState_ImageMounted ||
     
    276276        {
    277277            rc = image->attachTo (mParent->id(), mParent->snapshotId());
    278             if (SUCCEEDED (rc))
     278            if (SUCCEEDED(rc))
    279279            {
    280280                /* umount() will backup data */
    281281                rc = unmount();
    282282
    283                 if (SUCCEEDED (rc))
     283                if (SUCCEEDED(rc))
    284284                {
    285285                    /* lock the image for reading if the VM is online. It will
     
    291291                }
    292292
    293                 if (SUCCEEDED (rc))
     293                if (SUCCEEDED(rc))
    294294                {
    295295                    m->image = image;
     
    312312    CheckComArgNotNull(aHostDVDDrive);
    313313
    314     AutoCaller autoCaller (this);
    315     CheckComRCReturnRC (autoCaller.rc());
     314    AutoCaller autoCaller(this);
     315    CheckComRCReturnRC(autoCaller.rc());
    316316
    317317    /* the machine needs to be mutable */
    318318    Machine::AutoMutableStateDependency adep (mParent);
    319     CheckComRCReturnRC (adep.rc());
    320 
    321     AutoWriteLock alock (this);
     319    CheckComRCReturnRC(adep.rc());
     320
     321    AutoWriteLock alock(this);
    322322
    323323    if (m->state != DriveState_HostDriveCaptured ||
     
    326326        /* umount() will backup data */
    327327        HRESULT rc = unmount();
    328         if (SUCCEEDED (rc))
     328        if (SUCCEEDED(rc))
    329329        {
    330330            m->hostDrive = aHostDVDDrive;
     
    343343STDMETHODIMP DVDDrive::Unmount()
    344344{
    345     AutoCaller autoCaller (this);
    346     CheckComRCReturnRC (autoCaller.rc());
     345    AutoCaller autoCaller(this);
     346    CheckComRCReturnRC(autoCaller.rc());
    347347
    348348    /* the machine needs to be mutable */
    349349    Machine::AutoMutableStateDependency adep (mParent);
    350     CheckComRCReturnRC (adep.rc());
    351 
    352     AutoWriteLock alock (this);
     350    CheckComRCReturnRC(adep.rc());
     351
     352    AutoWriteLock alock(this);
    353353
    354354    if (m->state != DriveState_NotMounted)
     
    356356        /* umount() will backup data */
    357357        HRESULT rc = unmount();
    358         if (SUCCEEDED (rc))
     358        if (SUCCEEDED(rc))
    359359        {
    360360            m->state = DriveState_NotMounted;
     
    376376    CheckComArgOutPointerValid(aDVDImage);
    377377
    378     AutoCaller autoCaller (this);
    379     CheckComRCReturnRC (autoCaller.rc());
    380 
    381     AutoReadLock alock (this);
    382 
    383     m->image.queryInterfaceTo (aDVDImage);
     378    AutoCaller autoCaller(this);
     379    CheckComRCReturnRC(autoCaller.rc());
     380
     381    AutoReadLock alock(this);
     382
     383    m->image.queryInterfaceTo(aDVDImage);
    384384
    385385    return S_OK;
     
    390390    CheckComArgOutPointerValid(aHostDrive);
    391391
    392     AutoCaller autoCaller (this);
    393     CheckComRCReturnRC (autoCaller.rc());
    394 
    395     AutoReadLock alock (this);
    396 
    397     m->hostDrive.queryInterfaceTo (aHostDrive);
     392    AutoCaller autoCaller(this);
     393    CheckComRCReturnRC(autoCaller.rc());
     394
     395    AutoReadLock alock(this);
     396
     397    m->hostDrive.queryInterfaceTo(aHostDrive);
    398398
    399399    return S_OK;
     
    415415    using namespace settings;
    416416
    417     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    418 
    419     AutoCaller autoCaller (this);
    420     AssertComRCReturnRC (autoCaller.rc());
    421 
    422     AutoWriteLock alock (this);
     417    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     418
     419    AutoCaller autoCaller(this);
     420    AssertComRCReturnRC(autoCaller.rc());
     421
     422    AutoWriteLock alock(this);
    423423
    424424    /* Note: we assume that the default values for attributes of optional
     
    447447        Guid uuid = typeNode.value <Guid> ("uuid");
    448448        rc = MountImage (uuid.toUtf16());
    449         CheckComRCReturnRC (rc);
     449        CheckComRCReturnRC(rc);
    450450    }
    451451    else if (!(typeNode = dvdDriveNode.findKey ("HostDrive")).isNull())
     
    455455
    456456        /* find the corresponding object */
    457         ComObjPtr <Host> host = mParent->virtualBox()->host();
    458 
    459         com::SafeIfaceArray <IHostDVDDrive> coll;
     457        ComObjPtr<Host> host = mParent->virtualBox()->host();
     458
     459        com::SafeIfaceArray<IHostDVDDrive> coll;
    460460        rc = host->COMGETTER(DVDDrives) (ComSafeArrayAsOutParam(coll));
    461461        AssertComRC (rc);
    462462
    463         ComPtr <IHostDVDDrive> drive;
     463        ComPtr<IHostDVDDrive> drive;
    464464        rc = host->FindHostDVDDrive (src, drive.asOutParam());
    465465
    466         if (SUCCEEDED (rc))
     466        if (SUCCEEDED(rc))
    467467        {
    468468            rc = CaptureHostDrive (drive);
    469             CheckComRCReturnRC (rc);
     469            CheckComRCReturnRC(rc);
    470470        }
    471471        else if (rc == E_INVALIDARG)
     
    474474             * assume it will be available later and create an
    475475             * extra object now */
    476             ComObjPtr <HostDVDDrive> hostDrive;
     476            ComObjPtr<HostDVDDrive> hostDrive;
    477477            hostDrive.createObject();
    478478            rc = hostDrive->init (src);
    479479            AssertComRC (rc);
    480480            rc = CaptureHostDrive (hostDrive);
    481             CheckComRCReturnRC (rc);
     481            CheckComRCReturnRC(rc);
    482482        }
    483483        else
     
    499499    using namespace settings;
    500500
    501     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    502 
    503     AutoCaller autoCaller (this);
    504     AssertComRCReturnRC (autoCaller.rc());
    505 
    506     AutoReadLock alock (this);
     501    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     502
     503    AutoCaller autoCaller(this);
     504    AssertComRCReturnRC(autoCaller.rc());
     505
     506    AutoReadLock alock(this);
    507507
    508508    Key node = aMachineNode.createKey ("DVDDrive");
     
    555555{
    556556    /* sanity */
    557     AutoCaller autoCaller (this);
     557    AutoCaller autoCaller(this);
    558558    AssertComRCReturn (autoCaller.rc(), false);
    559559
     
    562562    AssertComRCReturn (adep.rc(), false);
    563563
    564     AutoWriteLock alock (this);
     564    AutoWriteLock alock(this);
    565565
    566566    bool changed = false;
     
    618618{
    619619    /* sanity */
    620     AutoCaller autoCaller (this);
     620    AutoCaller autoCaller(this);
    621621    AssertComRCReturnVoid (autoCaller.rc());
    622622
     
    649649
    650650    /* sanity */
    651     AutoCaller autoCaller (this);
     651    AutoCaller autoCaller(this);
    652652    AssertComRCReturnVoid (autoCaller.rc());
    653653
     
    671671HRESULT DVDDrive::unmount()
    672672{
    673     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     673    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    674674
    675675    /* we need adep for the state check */
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r21796 r21878  
    173173HRESULT Display::init (Console *aParent)
    174174{
    175     LogFlowThisFunc (("aParent=%p\n", aParent));
     175    LogFlowThisFunc(("aParent=%p\n", aParent));
    176176
    177177    ComAssertRet (aParent, E_INVALIDARG);
    178178
    179179    /* Enclose the state transition NotReady->InInit->Ready */
    180     AutoInitSpan autoInitSpan (this);
    181     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    182 
    183     unconst (mParent) = aParent;
     180    AutoInitSpan autoInitSpan(this);
     181    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     182
     183    unconst(mParent) = aParent;
    184184
    185185    // by default, we have an internal framebuffer which is
     
    229229void Display::uninit()
    230230{
    231     LogFlowThisFunc (("\n"));
     231    LogFlowThisFunc(("\n"));
    232232
    233233    /* Enclose the state transition Ready->InUninit->NotReady */
    234     AutoUninitSpan autoUninitSpan (this);
     234    AutoUninitSpan autoUninitSpan(this);
    235235    if (autoUninitSpan.uninitDone())
    236236        return;
     
    243243        mParent->UnregisterCallback (this);
    244244
    245     unconst (mParent).setNull();
     245    unconst(mParent).setNull();
    246246
    247247    if (mpDrv)
     
    13171317    CheckComArgNotNull(width);
    13181318
    1319     AutoCaller autoCaller (this);
    1320     CheckComRCReturnRC (autoCaller.rc());
    1321 
    1322     AutoWriteLock alock (this);
     1319    AutoCaller autoCaller(this);
     1320    CheckComRCReturnRC(autoCaller.rc());
     1321
     1322    AutoWriteLock alock(this);
    13231323
    13241324    CHECK_CONSOLE_DRV (mpDrv);
     
    13391339    CheckComArgNotNull(height);
    13401340
    1341     AutoCaller autoCaller (this);
    1342     CheckComRCReturnRC (autoCaller.rc());
    1343 
    1344     AutoWriteLock alock (this);
     1341    AutoCaller autoCaller(this);
     1342    CheckComRCReturnRC(autoCaller.rc());
     1343
     1344    AutoWriteLock alock(this);
    13451345
    13461346    CHECK_CONSOLE_DRV (mpDrv);
     
    13621362        return E_INVALIDARG;
    13631363
    1364     AutoCaller autoCaller (this);
    1365     CheckComRCReturnRC (autoCaller.rc());
    1366 
    1367     AutoWriteLock alock (this);
     1364    AutoCaller autoCaller(this);
     1365    CheckComRCReturnRC(autoCaller.rc());
     1366
     1367    AutoWriteLock alock(this);
    13681368
    13691369    CHECK_CONSOLE_DRV (mpDrv);
     
    13891389        CheckComArgOutPointerValid(aFramebuffer);
    13901390
    1391     AutoCaller autoCaller (this);
    1392     CheckComRCReturnRC (autoCaller.rc());
    1393 
    1394     AutoWriteLock alock (this);
     1391    AutoCaller autoCaller(this);
     1392    CheckComRCReturnRC(autoCaller.rc());
     1393
     1394    AutoWriteLock alock(this);
    13951395
    13961396    Console::SafeVMPtrQuiet pVM (mParent);
     
    14051405        int vrc = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    14061406            (PFNRT) changeFramebuffer, 3, this, aFramebuffer, aScreenId);
    1407         if (RT_SUCCESS (vrc))
     1407        if (RT_SUCCESS(vrc))
    14081408            vrc = pReq->iStatus;
    14091409        VMR3ReqFree (pReq);
     
    14301430    CheckComArgOutPointerValid(aFramebuffer);
    14311431
    1432     AutoCaller autoCaller (this);
    1433     CheckComRCReturnRC (autoCaller.rc());
    1434 
    1435     AutoWriteLock alock (this);
     1432    AutoCaller autoCaller(this);
     1433    CheckComRCReturnRC(autoCaller.rc());
     1434
     1435    AutoWriteLock alock(this);
    14361436
    14371437    /* @todo this should be actually done on EMT. */
     
    14521452    ULONG aBitsPerPixel, ULONG aDisplay)
    14531453{
    1454     AutoCaller autoCaller (this);
    1455     CheckComRCReturnRC (autoCaller.rc());
    1456 
    1457     AutoWriteLock alock (this);
     1454    AutoCaller autoCaller(this);
     1455    CheckComRCReturnRC(autoCaller.rc());
     1456
     1457    AutoWriteLock alock(this);
    14581458
    14591459    CHECK_CONSOLE_DRV (mpDrv);
     
    15021502STDMETHODIMP Display::SetSeamlessMode (BOOL enabled)
    15031503{
    1504     AutoCaller autoCaller (this);
    1505     CheckComRCReturnRC (autoCaller.rc());
    1506 
    1507     AutoWriteLock alock (this);
     1504    AutoCaller autoCaller(this);
     1505    CheckComRCReturnRC(autoCaller.rc());
     1506
     1507    AutoWriteLock alock(this);
    15081508
    15091509    /* Have to leave the lock because the pfnRequestSeamlessChange will call EMT.  */
     
    15321532    CheckComArgExpr(height, height != 0);
    15331533
    1534     AutoCaller autoCaller (this);
    1535     CheckComRCReturnRC (autoCaller.rc());
    1536 
    1537     AutoWriteLock alock (this);
     1534    AutoCaller autoCaller(this);
     1535    CheckComRCReturnRC(autoCaller.rc());
     1536
     1537    AutoWriteLock alock(this);
    15381538
    15391539    CHECK_CONSOLE_DRV (mpDrv);
    15401540
    15411541    Console::SafeVMPtr pVM (mParent);
    1542     CheckComRCReturnRC (pVM.rc());
     1542    CheckComRCReturnRC(pVM.rc());
    15431543
    15441544    HRESULT rc = S_OK;
     
    15881588
    15891589STDMETHODIMP Display::TakeScreenShotSlow (ULONG width, ULONG height,
    1590                                           ComSafeArrayOut (BYTE, aScreenData))
     1590                                          ComSafeArrayOut(BYTE, aScreenData))
    15911591{
    15921592     HRESULT rc = S_OK;
     
    16151615    CheckComArgExpr(height, height != 0);
    16161616
    1617     AutoCaller autoCaller (this);
    1618     CheckComRCReturnRC (autoCaller.rc());
    1619 
    1620     AutoWriteLock alock (this);
     1617    AutoCaller autoCaller(this);
     1618    CheckComRCReturnRC(autoCaller.rc());
     1619
     1620    AutoWriteLock alock(this);
    16211621
    16221622    CHECK_CONSOLE_DRV (mpDrv);
    16231623
    16241624    Console::SafeVMPtr pVM (mParent);
    1625     CheckComRCReturnRC (pVM.rc());
     1625    CheckComRCReturnRC(pVM.rc());
    16261626
    16271627    /*
     
    16741674    LogFlowFuncEnter();
    16751675
    1676     AutoCaller autoCaller (this);
    1677     CheckComRCReturnRC (autoCaller.rc());
    1678 
    1679     AutoWriteLock alock (this);
     1676    AutoCaller autoCaller(this);
     1677    CheckComRCReturnRC(autoCaller.rc());
     1678
     1679    AutoWriteLock alock(this);
    16801680
    16811681    CHECK_CONSOLE_DRV (mpDrv);
    16821682
    16831683    Console::SafeVMPtr pVM (mParent);
    1684     CheckComRCReturnRC (pVM.rc());
     1684    CheckComRCReturnRC(pVM.rc());
    16851685
    16861686    HRESULT rc = S_OK;
     
    17191719    LogFlowFunc (("\n"));
    17201720
    1721     /// @todo (dmik) can we AutoWriteLock alock (this); here?
     1721    /// @todo (dmik) can we AutoWriteLock alock(this); here?
    17221722    //  do it when we switch this class to VirtualBoxBase_NEXT.
    17231723    //  This will require general code review and may add some details.
     
    17271727    //  (and therefore don't use Display lock at all here to save some
    17281728    //  milliseconds).
    1729     AutoCaller autoCaller (this);
    1730     CheckComRCReturnRC (autoCaller.rc());
     1729    AutoCaller autoCaller(this);
     1730    CheckComRCReturnRC(autoCaller.rc());
    17311731
    17321732    /* this is only valid for external framebuffers */
     
    17551755    LogFlowFunc (("\n"));
    17561756
    1757     /// @todo (dmik) can we AutoWriteLock alock (this); here?
     1757    /// @todo (dmik) can we AutoWriteLock alock(this); here?
    17581758    //  do it when we switch this class to VirtualBoxBase_NEXT.
    17591759    //  Tthis will require general code review and may add some details.
     
    17631763    //  (and therefore don't use Display lock at all here to save some
    17641764    //  milliseconds).
    1765     AutoCaller autoCaller (this);
    1766     CheckComRCReturnRC (autoCaller.rc());
     1765    AutoCaller autoCaller(this);
     1766    CheckComRCReturnRC(autoCaller.rc());
    17671767
    17681768    /* this is only valid for external framebuffers */
     
    18891889    LogFlowFunc (("uScreenId = %d\n", uScreenId));
    18901890
    1891     AssertReturn (that, VERR_INVALID_PARAMETER);
    1892     AssertReturn (uScreenId < that->mcMonitors, VERR_INVALID_PARAMETER);
    1893 
    1894     AutoCaller autoCaller (that);
    1895     CheckComRCReturnRC (autoCaller.rc());
    1896 
    1897     AutoWriteLock alock (that);
     1891    AssertReturn(that, VERR_INVALID_PARAMETER);
     1892    AssertReturn(uScreenId < that->mcMonitors, VERR_INVALID_PARAMETER);
     1893
     1894    AutoCaller autoCaller(that);
     1895    CheckComRCReturnRC(autoCaller.rc());
     1896
     1897    AutoWriteLock alock(that);
    18981898
    18991899    DISPLAYFBINFO *pDisplayFBInfo = &that->maFramebuffers[uScreenId];
  • trunk/src/VBox/Main/FloppyDriveImpl.cpp

    r19511 r21878  
    6363HRESULT FloppyDrive::init (Machine *aParent)
    6464{
    65     LogFlowThisFunc (("aParent=%p\n", aParent));
     65    LogFlowThisFunc(("aParent=%p\n", aParent));
    6666
    6767    ComAssertRet (aParent, E_INVALIDARG);
    6868
    6969    /* Enclose the state transition NotReady->InInit->Ready */
    70     AutoInitSpan autoInitSpan (this);
    71     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    72 
    73     unconst (mParent) = aParent;
     70    AutoInitSpan autoInitSpan(this);
     71    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     72
     73    unconst(mParent) = aParent;
    7474    /* mPeer is left null */
    7575
     
    9494HRESULT FloppyDrive::init (Machine *aParent, FloppyDrive *aThat)
    9595{
    96     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     96    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    9797
    9898    ComAssertRet (aParent && aThat, E_INVALIDARG);
    9999
    100100    /* Enclose the state transition NotReady->InInit->Ready */
    101     AutoInitSpan autoInitSpan (this);
    102     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    103 
    104     unconst (mParent) = aParent;
    105     unconst (mPeer) = aThat;
     101    AutoInitSpan autoInitSpan(this);
     102    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     103
     104    unconst(mParent) = aParent;
     105    unconst(mPeer) = aThat;
    106106
    107107    AutoCaller thatCaller (aThat);
    108     AssertComRCReturnRC (thatCaller.rc());
     108    AssertComRCReturnRC(thatCaller.rc());
    109109
    110110    AutoReadLock thatLock (aThat);
     
    126126HRESULT FloppyDrive::initCopy (Machine *aParent, FloppyDrive *aThat)
    127127{
    128     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     128    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    129129
    130130    ComAssertRet (aParent && aThat, E_INVALIDARG);
    131131
    132132    /* Enclose the state transition NotReady->InInit->Ready */
    133     AutoInitSpan autoInitSpan (this);
    134     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    135 
    136     unconst (mParent) = aParent;
     133    AutoInitSpan autoInitSpan(this);
     134    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     135
     136    unconst(mParent) = aParent;
    137137    /* mPeer is left null */
    138138
    139139    AutoCaller thatCaller (aThat);
    140     AssertComRCReturnRC (thatCaller.rc());
     140    AssertComRCReturnRC(thatCaller.rc());
    141141
    142142    AutoReadLock thatLock (aThat);
     
    166166void FloppyDrive::uninit()
    167167{
    168     LogFlowThisFunc (("\n"));
     168    LogFlowThisFunc(("\n"));
    169169
    170170    /* Enclose the state transition Ready->InUninit->NotReady */
    171     AutoUninitSpan autoUninitSpan (this);
     171    AutoUninitSpan autoUninitSpan(this);
    172172    if (autoUninitSpan.uninitDone())
    173173        return;
     
    189189    m.free();
    190190
    191     unconst (mPeer).setNull();
    192     unconst (mParent).setNull();
     191    unconst(mPeer).setNull();
     192    unconst(mParent).setNull();
    193193}
    194194
     
    200200    CheckComArgOutPointerValid(aEnabled);
    201201
    202     AutoCaller autoCaller (this);
    203     CheckComRCReturnRC (autoCaller.rc());
    204 
    205     AutoReadLock alock (this);
     202    AutoCaller autoCaller(this);
     203    CheckComRCReturnRC(autoCaller.rc());
     204
     205    AutoReadLock alock(this);
    206206
    207207    *aEnabled = m->enabled;
     
    212212STDMETHODIMP FloppyDrive::COMSETTER(Enabled) (BOOL aEnabled)
    213213{
    214     LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
    215 
    216     AutoCaller autoCaller (this);
    217     CheckComRCReturnRC (autoCaller.rc());
     214    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     215
     216    AutoCaller autoCaller(this);
     217    CheckComRCReturnRC(autoCaller.rc());
    218218
    219219    /* the machine needs to be mutable */
    220220    Machine::AutoMutableStateDependency adep (mParent);
    221     CheckComRCReturnRC (adep.rc());
    222 
    223     AutoWriteLock alock (this);
     221    CheckComRCReturnRC(adep.rc());
     222
     223    AutoWriteLock alock(this);
    224224
    225225    if (m->enabled != aEnabled)
     
    241241    CheckComArgOutPointerValid(aState);
    242242
    243     AutoCaller autoCaller (this);
    244     CheckComRCReturnRC (autoCaller.rc());
    245 
    246     AutoReadLock alock (this);
     243    AutoCaller autoCaller(this);
     244    CheckComRCReturnRC(autoCaller.rc());
     245
     246    AutoReadLock alock(this);
    247247
    248248    *aState = m->state;
     
    259259    CheckComArgExpr(aImageId, !imageId.isEmpty());
    260260
    261     AutoCaller autoCaller (this);
    262     CheckComRCReturnRC (autoCaller.rc());
     261    AutoCaller autoCaller(this);
     262    CheckComRCReturnRC(autoCaller.rc());
    263263
    264264    /* the machine needs to be mutable */
    265265    Machine::AutoMutableStateDependency adep (mParent);
    266     CheckComRCReturnRC (adep.rc());
    267 
    268     AutoWriteLock alock (this);
     266    CheckComRCReturnRC(adep.rc());
     267
     268    AutoWriteLock alock(this);
    269269
    270270    HRESULT rc = E_FAIL;
     
    277277                                                true /* aSetError */, &image);
    278278
    279     if (SUCCEEDED (rc))
     279    if (SUCCEEDED(rc))
    280280    {
    281281        if (m->state != DriveState_ImageMounted ||
     
    283283        {
    284284            rc = image->attachTo (mParent->id(), mParent->snapshotId());
    285             if (SUCCEEDED (rc))
     285            if (SUCCEEDED(rc))
    286286            {
    287287                /* umount() will backup data */
    288288                rc = unmount();
    289289
    290                 if (SUCCEEDED (rc))
     290                if (SUCCEEDED(rc))
    291291                {
    292292                    /* lock the image for reading if the VM is online. It will
     
    298298                }
    299299
    300                 if (SUCCEEDED (rc))
     300                if (SUCCEEDED(rc))
    301301                {
    302302                    m->image = image;
     
    319319    CheckComArgNotNull(aHostFloppyDrive);
    320320
    321     AutoCaller autoCaller (this);
    322     CheckComRCReturnRC (autoCaller.rc());
     321    AutoCaller autoCaller(this);
     322    CheckComRCReturnRC(autoCaller.rc());
    323323
    324324    /* the machine needs to be mutable */
    325325    Machine::AutoMutableStateDependency adep (mParent);
    326     CheckComRCReturnRC (adep.rc());
    327 
    328     AutoWriteLock alock (this);
     326    CheckComRCReturnRC(adep.rc());
     327
     328    AutoWriteLock alock(this);
    329329
    330330    if (m->state != DriveState_HostDriveCaptured ||
     
    333333        /* umount() will backup data */
    334334        HRESULT rc = unmount();
    335         if (SUCCEEDED (rc))
     335        if (SUCCEEDED(rc))
    336336        {
    337337            m->hostDrive = aHostFloppyDrive;
     
    350350STDMETHODIMP FloppyDrive::Unmount()
    351351{
    352     AutoCaller autoCaller (this);
    353     CheckComRCReturnRC (autoCaller.rc());
     352    AutoCaller autoCaller(this);
     353    CheckComRCReturnRC(autoCaller.rc());
    354354
    355355    /* the machine needs to be mutable */
    356356    Machine::AutoMutableStateDependency adep (mParent);
    357     CheckComRCReturnRC (adep.rc());
    358 
    359     AutoWriteLock alock (this);
     357    CheckComRCReturnRC(adep.rc());
     358
     359    AutoWriteLock alock(this);
    360360
    361361    if (m->state != DriveState_NotMounted)
     
    363363        /* umount() will backup data */
    364364        HRESULT rc = unmount();
    365         if (SUCCEEDED (rc))
     365        if (SUCCEEDED(rc))
    366366        {
    367367            m->state = DriveState_NotMounted;
     
    383383    CheckComArgOutPointerValid(aFloppyImage);
    384384
    385     AutoCaller autoCaller (this);
    386     CheckComRCReturnRC (autoCaller.rc());
    387 
    388     AutoReadLock alock (this);
    389 
    390     m->image.queryInterfaceTo (aFloppyImage);
     385    AutoCaller autoCaller(this);
     386    CheckComRCReturnRC(autoCaller.rc());
     387
     388    AutoReadLock alock(this);
     389
     390    m->image.queryInterfaceTo(aFloppyImage);
    391391
    392392    return S_OK;
     
    397397    CheckComArgOutPointerValid(aHostDrive);
    398398
    399     AutoCaller autoCaller (this);
    400     CheckComRCReturnRC (autoCaller.rc());
    401 
    402     AutoReadLock alock (this);
    403 
    404     m->hostDrive.queryInterfaceTo (aHostDrive);
     399    AutoCaller autoCaller(this);
     400    CheckComRCReturnRC(autoCaller.rc());
     401
     402    AutoReadLock alock(this);
     403
     404    m->hostDrive.queryInterfaceTo(aHostDrive);
    405405
    406406    return S_OK;
     
    422422    using namespace settings;
    423423
    424     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    425 
    426     AutoCaller autoCaller (this);
    427     AssertComRCReturnRC (autoCaller.rc());
    428 
    429     AutoWriteLock alock (this);
     424    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     425
     426    AutoCaller autoCaller(this);
     427    AssertComRCReturnRC(autoCaller.rc());
     428
     429    AutoWriteLock alock(this);
    430430
    431431    /* Note: we assume that the default values for attributes of optional
     
    454454        Guid uuid = typeNode.value <Guid> ("uuid");
    455455        rc = MountImage (uuid.toUtf16());
    456         CheckComRCReturnRC (rc);
     456        CheckComRCReturnRC(rc);
    457457    }
    458458    else if (!(typeNode = floppyDriveNode.findKey ("HostDrive")).isNull())
     
    462462
    463463        /* find the corresponding object */
    464         ComObjPtr <Host> host = mParent->virtualBox()->host();
    465 
    466         com::SafeIfaceArray <IHostFloppyDrive> coll;
     464        ComObjPtr<Host> host = mParent->virtualBox()->host();
     465
     466        com::SafeIfaceArray<IHostFloppyDrive> coll;
    467467        rc = host->COMGETTER(FloppyDrives) (ComSafeArrayAsOutParam(coll));
    468468        AssertComRC (rc);
    469469
    470         ComPtr <IHostFloppyDrive> drive;
     470        ComPtr<IHostFloppyDrive> drive;
    471471        rc = host->FindHostFloppyDrive (src, drive.asOutParam());
    472472
    473         if (SUCCEEDED (rc))
     473        if (SUCCEEDED(rc))
    474474        {
    475475            rc = CaptureHostDrive (drive);
    476             CheckComRCReturnRC (rc);
     476            CheckComRCReturnRC(rc);
    477477        }
    478478        else if (rc == E_INVALIDARG)
     
    481481             * assume it will be available later and create an
    482482             * extra object now */
    483             ComObjPtr <HostFloppyDrive> hostDrive;
     483            ComObjPtr<HostFloppyDrive> hostDrive;
    484484            hostDrive.createObject();
    485485            rc = hostDrive->init (src);
    486486            AssertComRC (rc);
    487487            rc = CaptureHostDrive (hostDrive);
    488             CheckComRCReturnRC (rc);
     488            CheckComRCReturnRC(rc);
    489489        }
    490490        else
     
    506506    using namespace settings;
    507507
    508     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    509 
    510     AutoCaller autoCaller (this);
    511     AssertComRCReturnRC (autoCaller.rc());
    512 
    513     AutoReadLock alock (this);
     508    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     509
     510    AutoCaller autoCaller(this);
     511    AssertComRCReturnRC(autoCaller.rc());
     512
     513    AutoReadLock alock(this);
    514514
    515515    Key node = aMachineNode.createKey ("FloppyDrive");
     
    562562{
    563563    /* sanity */
    564     AutoCaller autoCaller (this);
     564    AutoCaller autoCaller(this);
    565565    AssertComRCReturn (autoCaller.rc(), false);
    566566
     
    569569    AssertComRCReturn (adep.rc(), false);
    570570
    571     AutoWriteLock alock (this);
     571    AutoWriteLock alock(this);
    572572
    573573    bool changed = false;
     
    626626{
    627627    /* sanity */
    628     AutoCaller autoCaller (this);
     628    AutoCaller autoCaller(this);
    629629    AssertComRCReturnVoid (autoCaller.rc());
    630630
     
    655655{
    656656    /* sanity */
    657     AutoCaller autoCaller (this);
     657    AutoCaller autoCaller(this);
    658658    AssertComRCReturnVoid (autoCaller.rc());
    659659
     
    677677HRESULT FloppyDrive::unmount()
    678678{
    679     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     679    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    680680
    681681    /* we need adep for the state check */
  • trunk/src/VBox/Main/GuestImpl.cpp

    r21219 r21878  
    5959HRESULT Guest::init (Console *aParent)
    6060{
    61     LogFlowThisFunc (("aParent=%p\n", aParent));
     61    LogFlowThisFunc(("aParent=%p\n", aParent));
    6262
    6363    ComAssertRet (aParent, E_INVALIDARG);
    6464
    6565    /* Enclose the state transition NotReady->InInit->Ready */
    66     AutoInitSpan autoInitSpan (this);
    67     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    68 
    69     unconst (mParent) = aParent;
     66    AutoInitSpan autoInitSpan(this);
     67    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     68
     69    unconst(mParent) = aParent;
    7070
    7171    /* mData.mAdditionsActive is FALSE */
     
    103103void Guest::uninit()
    104104{
    105     LogFlowThisFunc (("\n"));
     105    LogFlowThisFunc(("\n"));
    106106
    107107    /* Enclose the state transition Ready->InUninit->NotReady */
    108     AutoUninitSpan autoUninitSpan (this);
     108    AutoUninitSpan autoUninitSpan(this);
    109109    if (autoUninitSpan.uninitDone())
    110110        return;
    111111
    112     unconst (mParent).setNull();
     112    unconst(mParent).setNull();
    113113}
    114114
     
    120120    CheckComArgOutPointerValid(aOSTypeId);
    121121
    122     AutoCaller autoCaller (this);
    123     CheckComRCReturnRC (autoCaller.rc());
    124 
    125     AutoReadLock alock (this);
     122    AutoCaller autoCaller(this);
     123    CheckComRCReturnRC(autoCaller.rc());
     124
     125    AutoReadLock alock(this);
    126126
    127127    // redirect the call to IMachine if no additions are installed
     
    129129        return mParent->machine()->COMGETTER(OSTypeId) (aOSTypeId);
    130130
    131     mData.mOSTypeId.cloneTo (aOSTypeId);
     131    mData.mOSTypeId.cloneTo(aOSTypeId);
    132132
    133133    return S_OK;
     
    138138    CheckComArgOutPointerValid(aAdditionsActive);
    139139
    140     AutoCaller autoCaller (this);
    141     CheckComRCReturnRC (autoCaller.rc());
    142 
    143     AutoReadLock alock (this);
     140    AutoCaller autoCaller(this);
     141    CheckComRCReturnRC(autoCaller.rc());
     142
     143    AutoReadLock alock(this);
    144144
    145145    *aAdditionsActive = mData.mAdditionsActive;
     
    152152    CheckComArgOutPointerValid(aAdditionsVersion);
    153153
    154     AutoCaller autoCaller (this);
    155     CheckComRCReturnRC (autoCaller.rc());
    156 
    157     AutoReadLock alock (this);
    158 
    159     mData.mAdditionsVersion.cloneTo (aAdditionsVersion);
     154    AutoCaller autoCaller(this);
     155    CheckComRCReturnRC(autoCaller.rc());
     156
     157    AutoReadLock alock(this);
     158
     159    mData.mAdditionsVersion.cloneTo(aAdditionsVersion);
    160160
    161161    return S_OK;
     
    166166    CheckComArgOutPointerValid(aSupportsSeamless);
    167167
    168     AutoCaller autoCaller (this);
    169     CheckComRCReturnRC (autoCaller.rc());
    170 
    171     AutoReadLock alock (this);
     168    AutoCaller autoCaller(this);
     169    CheckComRCReturnRC(autoCaller.rc());
     170
     171    AutoReadLock alock(this);
    172172
    173173    *aSupportsSeamless = mData.mSupportsSeamless;
     
    180180    CheckComArgOutPointerValid(aSupportsGraphics);
    181181
    182     AutoCaller autoCaller (this);
    183     CheckComRCReturnRC (autoCaller.rc());
    184 
    185     AutoReadLock alock (this);
     182    AutoCaller autoCaller(this);
     183    CheckComRCReturnRC(autoCaller.rc());
     184
     185    AutoReadLock alock(this);
    186186
    187187    *aSupportsGraphics = mData.mSupportsGraphics;
     
    194194    CheckComArgOutPointerValid(aMemoryBalloonSize);
    195195
    196     AutoCaller autoCaller (this);
    197     CheckComRCReturnRC (autoCaller.rc());
    198 
    199     AutoReadLock alock (this);
     196    AutoCaller autoCaller(this);
     197    CheckComRCReturnRC(autoCaller.rc());
     198
     199    AutoReadLock alock(this);
    200200
    201201    *aMemoryBalloonSize = mMemoryBalloonSize;
     
    206206STDMETHODIMP Guest::COMSETTER(MemoryBalloonSize) (ULONG aMemoryBalloonSize)
    207207{
    208     AutoCaller autoCaller (this);
    209     CheckComRCReturnRC (autoCaller.rc());
    210 
    211     AutoWriteLock alock (this);
     208    AutoCaller autoCaller(this);
     209    CheckComRCReturnRC(autoCaller.rc());
     210
     211    AutoWriteLock alock(this);
    212212
    213213    HRESULT ret = mParent->machine()->COMSETTER(MemoryBalloonSize)(aMemoryBalloonSize);
     
    228228    CheckComArgOutPointerValid(aUpdateInterval);
    229229
    230     AutoCaller autoCaller (this);
    231     CheckComRCReturnRC (autoCaller.rc());
    232 
    233     AutoReadLock alock (this);
     230    AutoCaller autoCaller(this);
     231    CheckComRCReturnRC(autoCaller.rc());
     232
     233    AutoReadLock alock(this);
    234234
    235235    *aUpdateInterval = mStatUpdateInterval;
     
    240240STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval) (ULONG aUpdateInterval)
    241241{
    242     AutoCaller autoCaller (this);
    243     CheckComRCReturnRC (autoCaller.rc());
    244 
    245     AutoWriteLock alock (this);
     242    AutoCaller autoCaller(this);
     243    CheckComRCReturnRC(autoCaller.rc());
     244
     245    AutoWriteLock alock(this);
    246246
    247247    HRESULT ret = mParent->machine()->COMSETTER(StatisticsUpdateInterval)(aUpdateInterval);
     
    265265    CheckComArgNotNull(aDomain);
    266266
    267     AutoCaller autoCaller (this);
    268     CheckComRCReturnRC (autoCaller.rc());
     267    AutoCaller autoCaller(this);
     268    CheckComRCReturnRC(autoCaller.rc());
    269269
    270270    /* forward the information to the VMM device */
     
    318318    Assert(aVersion.isNull() || !aVersion.isEmpty());
    319319
    320     AutoCaller autoCaller (this);
     320    AutoCaller autoCaller(this);
    321321    AssertComRCReturnVoid (autoCaller.rc());
    322322
    323     AutoWriteLock alock (this);
     323    AutoWriteLock alock(this);
    324324
    325325    mData.mAdditionsVersion = aVersion;
     
    331331void Guest::setSupportsSeamless (BOOL aSupportsSeamless)
    332332{
    333     AutoCaller autoCaller (this);
     333    AutoCaller autoCaller(this);
    334334    AssertComRCReturnVoid (autoCaller.rc());
    335335
    336     AutoWriteLock alock (this);
     336    AutoWriteLock alock(this);
    337337
    338338    mData.mSupportsSeamless = aSupportsSeamless;
     
    341341void Guest::setSupportsGraphics (BOOL aSupportsGraphics)
    342342{
    343     AutoCaller autoCaller (this);
     343    AutoCaller autoCaller(this);
    344344    AssertComRCReturnVoid (autoCaller.rc());
    345345
    346     AutoWriteLock alock (this);
     346    AutoWriteLock alock(this);
    347347
    348348    mData.mSupportsGraphics = aSupportsGraphics;
  • trunk/src/VBox/Main/GuestOSTypeImpl.cpp

    r21607 r21878  
    7575{
    7676#if 0
    77     LogFlowThisFunc (("aFamilyId='%s', aFamilyDescription='%s', "
     77    LogFlowThisFunc(("aFamilyId='%s', aFamilyDescription='%s', "
    7878                      "aId='%s', aDescription='%s', "
    7979                      "aType=%d, aOSHint=%x, "
     
    9090
    9191    /* Enclose the state transition NotReady->InInit->Ready */
    92     AutoInitSpan autoInitSpan (this);
    93     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    94 
    95     unconst (mFamilyID) = aFamilyId;
    96     unconst (mFamilyDescription) = aFamilyDescription;
    97     unconst (mID) = aId;
    98     unconst (mDescription) = aDescription;
    99     unconst (mOSType) = aOSType;
    100     unconst (mOSHint) = aOSHint;
    101     unconst (mRAMSize) = aRAMSize;
    102     unconst (mVRAMSize) = aVRAMSize;
    103     unconst (mHDDSize) = aHDDSize;
    104     unconst (mNetworkAdapterType) = aNetworkAdapterType;
    105     unconst (mNumSerialEnabled) = aNumSerialEnabled;
     92    AutoInitSpan autoInitSpan(this);
     93    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     94
     95    unconst(mFamilyID) = aFamilyId;
     96    unconst(mFamilyDescription) = aFamilyDescription;
     97    unconst(mID) = aId;
     98    unconst(mDescription) = aDescription;
     99    unconst(mOSType) = aOSType;
     100    unconst(mOSHint) = aOSHint;
     101    unconst(mRAMSize) = aRAMSize;
     102    unconst(mVRAMSize) = aVRAMSize;
     103    unconst(mHDDSize) = aHDDSize;
     104    unconst(mNetworkAdapterType) = aNetworkAdapterType;
     105    unconst(mNumSerialEnabled) = aNumSerialEnabled;
    106106
    107107    /* Confirm a successful initialization when it's the case */
     
    118118{
    119119    /* Enclose the state transition Ready->InUninit->NotReady */
    120     AutoUninitSpan autoUninitSpan (this);
     120    AutoUninitSpan autoUninitSpan(this);
    121121    if (autoUninitSpan.uninitDone())
    122122        return;
     
    130130    CheckComArgOutPointerValid(aFamilyId);
    131131
    132     AutoCaller autoCaller (this);
    133     CheckComRCReturnRC (autoCaller.rc());
     132    AutoCaller autoCaller(this);
     133    CheckComRCReturnRC(autoCaller.rc());
    134134
    135135    /* mFamilyID is constant during life time, no need to lock */
    136     mFamilyID.cloneTo (aFamilyId);
     136    mFamilyID.cloneTo(aFamilyId);
    137137
    138138    return S_OK;
     
    143143    CheckComArgOutPointerValid(aFamilyDescription);
    144144
    145     AutoCaller autoCaller (this);
    146     CheckComRCReturnRC (autoCaller.rc());
     145    AutoCaller autoCaller(this);
     146    CheckComRCReturnRC(autoCaller.rc());
    147147
    148148    /* mFamilyDescription is constant during life time, no need to lock */
    149     mFamilyDescription.cloneTo (aFamilyDescription);
     149    mFamilyDescription.cloneTo(aFamilyDescription);
    150150
    151151    return S_OK;
     
    156156    CheckComArgOutPointerValid(aId);
    157157
    158     AutoCaller autoCaller (this);
    159     CheckComRCReturnRC (autoCaller.rc());
     158    AutoCaller autoCaller(this);
     159    CheckComRCReturnRC(autoCaller.rc());
    160160
    161161    /* mID is constant during life time, no need to lock */
    162     mID.cloneTo (aId);
     162    mID.cloneTo(aId);
    163163
    164164    return S_OK;
     
    169169    CheckComArgOutPointerValid(aDescription);
    170170
    171     AutoCaller autoCaller (this);
    172     CheckComRCReturnRC (autoCaller.rc());
     171    AutoCaller autoCaller(this);
     172    CheckComRCReturnRC(autoCaller.rc());
    173173
    174174    /* mDescription is constant during life time, no need to lock */
    175     mDescription.cloneTo (aDescription);
     175    mDescription.cloneTo(aDescription);
    176176
    177177    return S_OK;
     
    182182    CheckComArgOutPointerValid(aIs64Bit);
    183183
    184     AutoCaller autoCaller (this);
    185     CheckComRCReturnRC (autoCaller.rc());
     184    AutoCaller autoCaller(this);
     185    CheckComRCReturnRC(autoCaller.rc());
    186186
    187187    /* mIs64Bit is constant during life time, no need to lock */
     
    195195    CheckComArgOutPointerValid(aRecommendedIOAPIC);
    196196
    197     AutoCaller autoCaller (this);
    198     CheckComRCReturnRC (autoCaller.rc());
     197    AutoCaller autoCaller(this);
     198    CheckComRCReturnRC(autoCaller.rc());
    199199
    200200    /* mRecommendedIOAPIC is constant during life time, no need to lock */
     
    208208    CheckComArgOutPointerValid(aRecommendedVirtEx);
    209209
    210     AutoCaller autoCaller (this);
    211     CheckComRCReturnRC (autoCaller.rc());
     210    AutoCaller autoCaller(this);
     211    CheckComRCReturnRC(autoCaller.rc());
    212212
    213213    /* mRecommendedVirtEx is constant during life time, no need to lock */
     
    221221    CheckComArgOutPointerValid(aRAMSize);
    222222
    223     AutoCaller autoCaller (this);
    224     CheckComRCReturnRC (autoCaller.rc());
     223    AutoCaller autoCaller(this);
     224    CheckComRCReturnRC(autoCaller.rc());
    225225
    226226    /* mRAMSize is constant during life time, no need to lock */
     
    234234    CheckComArgOutPointerValid(aVRAMSize);
    235235
    236     AutoCaller autoCaller (this);
    237     CheckComRCReturnRC (autoCaller.rc());
     236    AutoCaller autoCaller(this);
     237    CheckComRCReturnRC(autoCaller.rc());
    238238
    239239    /* mVRAMSize is constant during life time, no need to lock */
     
    247247    CheckComArgOutPointerValid(aHDDSize);
    248248
    249     AutoCaller autoCaller (this);
    250     CheckComRCReturnRC (autoCaller.rc());
     249    AutoCaller autoCaller(this);
     250    CheckComRCReturnRC(autoCaller.rc());
    251251
    252252    /* mHDDSize is constant during life time, no need to lock */
     
    260260    CheckComArgOutPointerValid(aNetworkAdapterType);
    261261
    262     AutoCaller autoCaller (this);
    263     CheckComRCReturnRC (autoCaller.rc());
     262    AutoCaller autoCaller(this);
     263    CheckComRCReturnRC(autoCaller.rc());
    264264
    265265    /* mNetworkAdapterType is constant during life time, no need to lock */
  • trunk/src/VBox/Main/HardDiskAttachmentImpl.cpp

    r17671 r21878  
    5252                                 LONG aDevice, bool aImplicit /*= false*/)
    5353{
    54     AssertReturn (aHD, E_INVALIDARG);
     54    AssertReturn(aHD, E_INVALIDARG);
    5555
    5656    /* Enclose the state transition NotReady->InInit->Ready */
    57     AutoInitSpan autoInitSpan (this);
    58     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     57    AutoInitSpan autoInitSpan(this);
     58    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    5959
    6060    m.hardDisk = aHD;
    61     unconst (m.controller) = aController;
    62     unconst (m.port)   = aPort;
    63     unconst (m.device) = aDevice;
     61    unconst(m.controller) = aController;
     62    unconst(m.port)   = aPort;
     63    unconst(m.device) = aDevice;
    6464
    6565    m.implicit = aImplicit;
     
    7878{
    7979    /* Enclose the state transition Ready->InUninit->NotReady */
    80     AutoUninitSpan autoUninitSpan (this);
     80    AutoUninitSpan autoUninitSpan(this);
    8181    if (autoUninitSpan.uninitDone())
    8282        return;
     
    9090    CheckComArgOutPointerValid(aHardDisk);
    9191
    92     AutoCaller autoCaller (this);
    93     CheckComRCReturnRC (autoCaller.rc());
     92    AutoCaller autoCaller(this);
     93    CheckComRCReturnRC(autoCaller.rc());
    9494
    95     AutoReadLock alock (this);
     95    AutoReadLock alock(this);
    9696
    97     m.hardDisk.queryInterfaceTo (aHardDisk);
     97    m.hardDisk.queryInterfaceTo(aHardDisk);
    9898
    9999    return S_OK;
     
    104104    CheckComArgOutPointerValid(aController);
    105105
    106     AutoCaller autoCaller (this);
    107     CheckComRCReturnRC (autoCaller.rc());
     106    AutoCaller autoCaller(this);
     107    CheckComRCReturnRC(autoCaller.rc());
    108108
    109109    /* m.controller is constant during life time, no need to lock */
     
    117117    CheckComArgOutPointerValid(aPort);
    118118
    119     AutoCaller autoCaller (this);
    120     CheckComRCReturnRC (autoCaller.rc());
     119    AutoCaller autoCaller(this);
     120    CheckComRCReturnRC(autoCaller.rc());
    121121
    122122    /* m.port is constant during life time, no need to lock */
     
    130130    CheckComArgOutPointerValid(aDevice);
    131131
    132     AutoCaller autoCaller (this);
    133     CheckComRCReturnRC (autoCaller.rc());
     132    AutoCaller autoCaller(this);
     133    CheckComRCReturnRC(autoCaller.rc());
    134134
    135135    /* m.device is constant during life time, no need to lock */
  • trunk/src/VBox/Main/HardDiskFormatImpl.cpp

    r16873 r21878  
    5252HRESULT HardDiskFormat::init (const VDBACKENDINFO *aVDInfo)
    5353{
    54     LogFlowThisFunc (("aVDInfo=%p\n", aVDInfo));
     54    LogFlowThisFunc(("aVDInfo=%p\n", aVDInfo));
    5555
    5656    ComAssertRet (aVDInfo, E_INVALIDARG);
    5757
    5858    /* Enclose the state transition NotReady->InInit->Ready */
    59     AutoInitSpan autoInitSpan (this);
    60     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     59    AutoInitSpan autoInitSpan(this);
     60    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6161
    6262    /* The ID of the backend */
    63     unconst (m.id) = aVDInfo->pszBackend;
     63    unconst(m.id) = aVDInfo->pszBackend;
    6464    /* The Name of the backend */
    6565    /* Use id for now as long as VDBACKENDINFO hasn't any extra
    6666     * name/description field. */
    67     unconst (m.name) = aVDInfo->pszBackend;
     67    unconst(m.name) = aVDInfo->pszBackend;
    6868    /* The capabilities of the backend */
    69     unconst (m.capabilities) = aVDInfo->uBackendCaps;
     69    unconst(m.capabilities) = aVDInfo->uBackendCaps;
    7070    /* Save the supported file extensions in a list */
    7171    if (aVDInfo->papszFileExtensions)
     
    7474        while (*papsz != NULL)
    7575        {
    76             unconst (m.fileExtensions).push_back (*papsz);
     76            unconst(m.fileExtensions).push_back (*papsz);
    7777            ++ papsz;
    7878        }
     
    137137                                    flags,
    138138                                    defaultValue };
    139             unconst (m.properties).push_back (prop);
     139            unconst(m.properties).push_back (prop);
    140140            ++ pa;
    141141        }
     
    154154void HardDiskFormat::uninit()
    155155{
    156     LogFlowThisFunc (("\n"));
     156    LogFlowThisFunc(("\n"));
    157157
    158158    /* Enclose the state transition Ready->InUninit->NotReady */
    159     AutoUninitSpan autoUninitSpan (this);
     159    AutoUninitSpan autoUninitSpan(this);
    160160    if (autoUninitSpan.uninitDone())
    161161        return;
    162162
    163     unconst (m.properties).clear();
    164     unconst (m.fileExtensions).clear();
    165     unconst (m.capabilities) = 0;
    166     unconst (m.name).setNull();
    167     unconst (m.id).setNull();
     163    unconst(m.properties).clear();
     164    unconst(m.fileExtensions).clear();
     165    unconst(m.capabilities) = 0;
     166    unconst(m.name).setNull();
     167    unconst(m.id).setNull();
    168168}
    169169
     
    175175    CheckComArgOutPointerValid(aId);
    176176
    177     AutoCaller autoCaller (this);
    178     CheckComRCReturnRC (autoCaller.rc());
    179 
    180     /* this is const, no need to lock */
    181     m.id.cloneTo (aId);
     177    AutoCaller autoCaller(this);
     178    CheckComRCReturnRC(autoCaller.rc());
     179
     180    /* this is const, no need to lock */
     181    m.id.cloneTo(aId);
    182182
    183183    return S_OK;
     
    188188    CheckComArgOutPointerValid(aName);
    189189
    190     AutoCaller autoCaller (this);
    191     CheckComRCReturnRC (autoCaller.rc());
    192 
    193     /* this is const, no need to lock */
    194     m.name.cloneTo (aName);
     190    AutoCaller autoCaller(this);
     191    CheckComRCReturnRC(autoCaller.rc());
     192
     193    /* this is const, no need to lock */
     194    m.name.cloneTo(aName);
    195195
    196196    return S_OK;
     
    198198
    199199STDMETHODIMP HardDiskFormat::
    200 COMGETTER(FileExtensions)(ComSafeArrayOut (BSTR, aFileExtensions))
    201 {
    202     if (ComSafeArrayOutIsNull (aFileExtensions))
     200COMGETTER(FileExtensions)(ComSafeArrayOut(BSTR, aFileExtensions))
     201{
     202    if (ComSafeArrayOutIsNull(aFileExtensions))
    203203        return E_POINTER;
    204204
    205     AutoCaller autoCaller (this);
    206     CheckComRCReturnRC (autoCaller.rc());
    207 
    208     /* this is const, no need to lock */
    209     com::SafeArray <BSTR> fileExtentions (m.fileExtensions.size());
     205    AutoCaller autoCaller(this);
     206    CheckComRCReturnRC(autoCaller.rc());
     207
     208    /* this is const, no need to lock */
     209    com::SafeArray<BSTR> fileExtentions (m.fileExtensions.size());
    210210    int i = 0;
    211211    for (BstrList::const_iterator it = m.fileExtensions.begin();
    212212        it != m.fileExtensions.end(); ++ it, ++ i)
    213         (*it).cloneTo (&fileExtentions [i]);
    214     fileExtentions.detachTo (ComSafeArrayOutArg (aFileExtensions));
     213        (*it).cloneTo(&fileExtentions [i]);
     214    fileExtentions.detachTo(ComSafeArrayOutArg(aFileExtensions));
    215215
    216216    return S_OK;
     
    221221    CheckComArgOutPointerValid(aCaps);
    222222
    223     AutoCaller autoCaller (this);
    224     CheckComRCReturnRC (autoCaller.rc());
     223    AutoCaller autoCaller(this);
     224    CheckComRCReturnRC(autoCaller.rc());
    225225
    226226    /* m.capabilities is const, no need to lock */
     
    237237}
    238238
    239 STDMETHODIMP HardDiskFormat::DescribeProperties(ComSafeArrayOut (BSTR, aNames),
    240                                                 ComSafeArrayOut (BSTR, aDescriptions),
    241                                                 ComSafeArrayOut (DataType_T, aTypes),
    242                                                 ComSafeArrayOut (ULONG, aFlags),
    243                                                 ComSafeArrayOut (BSTR, aDefaults))
     239STDMETHODIMP HardDiskFormat::DescribeProperties(ComSafeArrayOut(BSTR, aNames),
     240                                                ComSafeArrayOut(BSTR, aDescriptions),
     241                                                ComSafeArrayOut(DataType_T, aTypes),
     242                                                ComSafeArrayOut(ULONG, aFlags),
     243                                                ComSafeArrayOut(BSTR, aDefaults))
    244244{
    245245    CheckComArgSafeArrayNotNull(aNames);
     
    249249    CheckComArgSafeArrayNotNull(aDefaults);
    250250
    251     AutoCaller autoCaller (this);
    252     CheckComRCReturnRC (autoCaller.rc());
    253 
    254     /* this is const, no need to lock */
    255     com::SafeArray <BSTR> propertyNames (m.properties.size());
    256     com::SafeArray <BSTR> propertyDescriptions (m.properties.size());
    257     com::SafeArray <DataType_T> propertyTypes (m.properties.size());
    258     com::SafeArray <ULONG> propertyFlags (m.properties.size());
    259     com::SafeArray <BSTR> propertyDefaults (m.properties.size());
     251    AutoCaller autoCaller(this);
     252    CheckComRCReturnRC(autoCaller.rc());
     253
     254    /* this is const, no need to lock */
     255    com::SafeArray<BSTR> propertyNames (m.properties.size());
     256    com::SafeArray<BSTR> propertyDescriptions (m.properties.size());
     257    com::SafeArray<DataType_T> propertyTypes (m.properties.size());
     258    com::SafeArray<ULONG> propertyFlags (m.properties.size());
     259    com::SafeArray<BSTR> propertyDefaults (m.properties.size());
    260260
    261261    int i = 0;
     
    264264    {
    265265        const Property &prop = (*it);
    266         prop.name.cloneTo (&propertyNames [i]);
    267         prop.description.cloneTo (&propertyDescriptions [i]);
     266        prop.name.cloneTo(&propertyNames [i]);
     267        prop.description.cloneTo(&propertyDescriptions [i]);
    268268        propertyTypes [i] = prop.type;
    269269        propertyFlags [i] = prop.flags;
    270         prop.defaultValue.cloneTo (&propertyDefaults [i]);
     270        prop.defaultValue.cloneTo(&propertyDefaults [i]);
    271271    }
    272272
    273     propertyNames.detachTo (ComSafeArrayOutArg (aNames));
    274     propertyDescriptions.detachTo (ComSafeArrayOutArg (aDescriptions));
    275     propertyTypes.detachTo (ComSafeArrayOutArg (aTypes));
    276     propertyFlags.detachTo (ComSafeArrayOutArg (aFlags));
    277     propertyDefaults.detachTo (ComSafeArrayOutArg (aDefaults));
     273    propertyNames.detachTo(ComSafeArrayOutArg(aNames));
     274    propertyDescriptions.detachTo(ComSafeArrayOutArg(aDescriptions));
     275    propertyTypes.detachTo(ComSafeArrayOutArg(aTypes));
     276    propertyFlags.detachTo(ComSafeArrayOutArg(aFlags));
     277    propertyDefaults.detachTo(ComSafeArrayOutArg(aDefaults));
    278278
    279279    return S_OK;
  • trunk/src/VBox/Main/HardDiskImpl.cpp

    r21806 r21878  
    6464    VirtualBoxBaseProto::AutoCaller autoCaller;
    6565
    66     ComObjPtr <Progress> progress;
     66    ComObjPtr<Progress> progress;
    6767    Operation operation;
    6868
     
    250250        for (iterator it = begin(); it != end(); ++ it)
    251251        {
    252             AutoWriteLock alock (*it);
     252            AutoWriteLock alock(*it);
    253253            Assert ((*it)->m.state == MediaState_LockedWrite ||
    254254                    (*it)->m.state == MediaState_Deleting);
     
    268268    {
    269269        HRESULT rc = aHardDisk->addCaller();
    270         CheckComRCReturnRC (rc);
    271 
    272         AutoWriteLock alock (aHardDisk);
     270        CheckComRCReturnRC(rc);
     271
     272        AutoWriteLock alock(aHardDisk);
    273273
    274274        if (mForward)
     
    288288        MediaState_T m;
    289289        rc = aHardDisk->COMGETTER(State)(&m);
    290         CheckComRCReturnRC (rc);
     290        CheckComRCReturnRC(rc);
    291291        /* go to Deleting */
    292292        switch (m)
     
    308308            {
    309309                rc = aHardDisk->mParent->addCaller();
    310                 CheckComRCReturnRC (rc);
     310                CheckComRCReturnRC(rc);
    311311
    312312                mParent = aHardDisk->mParent;
     
    320320            {
    321321                rc = (*it)->addCaller();
    322                 CheckComRCReturnRC (rc);
     322                CheckComRCReturnRC(rc);
    323323
    324324                rc = (*it)->LockWrite (NULL);
     
    339339    {
    340340        HRESULT rc = aHardDisk->addCaller();
    341         CheckComRCReturnRC (rc);
    342 
    343         AutoWriteLock alock (aHardDisk);
     341        CheckComRCReturnRC(rc);
     342
     343        AutoWriteLock alock(aHardDisk);
    344344
    345345        if (!mForward)
     
    369369    {
    370370        HRESULT rc = aHardDisk->addCaller();
    371         CheckComRCReturnRC (rc);
    372 
    373         AutoWriteLock alock (aHardDisk);
     371        CheckComRCReturnRC(rc);
     372
     373        AutoWriteLock alock(aHardDisk);
    374374
    375375        rc = checkChildrenAndAttachments (aHardDisk);
     
    401401
    402402    HardDisk *source() const
    403     { AssertReturn (size() > 0, NULL); return mForward ? front() : back(); }
     403    { AssertReturn(size() > 0, NULL); return mForward ? front() : back(); }
    404404
    405405    HardDisk *target() const
    406     { AssertReturn (size() > 0, NULL); return mForward ? back() : front(); }
     406    { AssertReturn(size() > 0, NULL); return mForward ? back() : front(); }
    407407
    408408protected:
     
    467467
    468468    /** Parent of the source when forward merge (if any) */
    469     ComObjPtr <HardDisk> mParent;
     469    ComObjPtr<HardDisk> mParent;
    470470    /** Children of the source when backward merge (if any) */
    471471    List mChildren;
     
    496496            for (List::const_iterator it = begin(); it != end(); ++ it)
    497497            {
    498                 AutoWriteLock alock (*it);
     498                AutoWriteLock alock(*it);
    499499                if (it == last)
    500500                {
     
    521521    {
    522522        HRESULT rc = aHardDisk->addCaller();
    523         CheckComRCReturnRC (rc);
     523        CheckComRCReturnRC(rc);
    524524
    525525        push_front (aHardDisk);
     
    540540            MediaState_T mediaState;
    541541            rc = (*it)->LockRead(&mediaState);
    542             CheckComRCReturnRC (rc);
     542            CheckComRCReturnRC(rc);
    543543
    544544            if (mediaState == MediaState_Inaccessible)
    545545            {
    546546                rc = (*it)->COMGETTER(State) (&mediaState);
    547                 CheckComRCReturnRC (rc);
     547                CheckComRCReturnRC(rc);
    548548                Assert (mediaState == MediaState_LockedRead);
    549549
     
    552552                Bstr error;
    553553                rc = (*it)->COMGETTER(LastAccessError) (error.asOutParam());
    554                 CheckComRCReturnRC (rc);
     554                CheckComRCReturnRC(rc);
    555555
    556556                if (!error.isEmpty())
     
    575575
    576576        eik.restore();
    577         CheckComRCReturnRC ((HRESULT) mrc);
     577        CheckComRCReturnRC((HRESULT) mrc);
    578578
    579579        return S_OK;
     
    597597            else
    598598                rc = (*it)->LockRead(&mediaState);
    599             CheckComRCReturnRC (rc);
     599            CheckComRCReturnRC(rc);
    600600
    601601            if (mediaState == MediaState_Inaccessible)
    602602            {
    603603                rc = (*it)->COMGETTER(State) (&mediaState);
    604                 CheckComRCReturnRC (rc);
     604                CheckComRCReturnRC(rc);
    605605                if (it == last)
    606606                    Assert (mediaState == MediaState_LockedWrite);
     
    612612                Bstr error;
    613613                rc = (*it)->COMGETTER(LastAccessError) (error.asOutParam());
    614                 CheckComRCReturnRC (rc);
     614                CheckComRCReturnRC(rc);
    615615
    616616                if (!error.isEmpty())
     
    635635
    636636        eik.restore();
    637         CheckComRCReturnRC ((HRESULT) mrc);
     637        CheckComRCReturnRC((HRESULT) mrc);
    638638
    639639        return S_OK;
     
    743743                        CBSTR aLocation)
    744744{
    745     AssertReturn (aVirtualBox != NULL, E_FAIL);
    746     AssertReturn (aFormat != NULL && *aFormat != '\0', E_FAIL);
     745    AssertReturn(aVirtualBox != NULL, E_FAIL);
     746    AssertReturn(aFormat != NULL && *aFormat != '\0', E_FAIL);
    747747
    748748    /* Enclose the state transition NotReady->InInit->Ready */
    749     AutoInitSpan autoInitSpan (this);
    750     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     749    AutoInitSpan autoInitSpan(this);
     750    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    751751
    752752    HRESULT rc = S_OK;
    753753
    754754    /* share VirtualBox weakly (parent remains NULL so far) */
    755     unconst (mVirtualBox) = aVirtualBox;
     755    unconst(mVirtualBox) = aVirtualBox;
    756756
    757757    /* register with VirtualBox early, since uninit() will
     
    765765
    766766    rc = setFormat (aFormat);
    767     CheckComRCReturnRC (rc);
     767    CheckComRCReturnRC(rc);
    768768
    769769    if (mm.formatObj->capabilities() & HardDiskFormatCapabilities_File)
    770770    {
    771771        rc = setLocation (aLocation);
    772         CheckComRCReturnRC (rc);
     772        CheckComRCReturnRC(rc);
    773773    }
    774774    else
    775775    {
    776776        rc = setLocation (aLocation);
    777         CheckComRCReturnRC (rc);
     777        CheckComRCReturnRC(rc);
    778778
    779779        /// @todo later we may want to use a pfnComposeLocation backend info
     
    791791         * Created state here and also add it to the registry */
    792792        m.state = MediaState_Created;
    793         unconst (m.id).create();
     793        unconst(m.id).create();
    794794        rc = mVirtualBox->registerHardDisk (this);
    795795
     
    803803
    804804    /* Confirm a successful initialization when it's the case */
    805     if (SUCCEEDED (rc))
     805    if (SUCCEEDED(rc))
    806806        autoInitSpan.setSucceeded();
    807807
     
    837837                       const Guid &aParentId)
    838838{
    839     AssertReturn (aVirtualBox, E_INVALIDARG);
    840     AssertReturn (aLocation, E_INVALIDARG);
     839    AssertReturn(aVirtualBox, E_INVALIDARG);
     840    AssertReturn(aLocation, E_INVALIDARG);
    841841
    842842    /* Enclose the state transition NotReady->InInit->Ready */
    843     AutoInitSpan autoInitSpan (this);
    844     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     843    AutoInitSpan autoInitSpan(this);
     844    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    845845
    846846    HRESULT rc = S_OK;
    847847
    848848    /* share VirtualBox weakly (parent remains NULL so far) */
    849     unconst (mVirtualBox) = aVirtualBox;
     849    unconst(mVirtualBox) = aVirtualBox;
    850850
    851851    /* register with VirtualBox early, since uninit() will
     
    860860
    861861    rc = setLocation (aLocation);
    862     CheckComRCReturnRC (rc);
     862    CheckComRCReturnRC(rc);
    863863
    864864    /* save the new uuid values, will be used by queryInfo() */
     
    890890
    891891    /* Confirm a successful initialization when it's the case */
    892     if (SUCCEEDED (rc))
     892    if (SUCCEEDED(rc))
    893893        autoInitSpan.setSucceeded();
    894894
     
    912912    using namespace settings;
    913913
    914     AssertReturn (aVirtualBox, E_INVALIDARG);
     914    AssertReturn(aVirtualBox, E_INVALIDARG);
    915915
    916916    /* Enclose the state transition NotReady->InInit->Ready */
    917     AutoInitSpan autoInitSpan (this);
    918     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     917    AutoInitSpan autoInitSpan(this);
     918    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    919919
    920920    HRESULT rc = S_OK;
    921921
    922922    /* share VirtualBox and parent weakly */
    923     unconst (mVirtualBox) = aVirtualBox;
     923    unconst(mVirtualBox) = aVirtualBox;
    924924
    925925    /* register with VirtualBox/parent early, since uninit() will
     
    942942
    943943    /* required */
    944     unconst (m.id) = aNode.value <Guid> ("uuid");
     944    unconst(m.id) = aNode.value <Guid> ("uuid");
    945945
    946946    /* optional */
     
    953953    /* required */
    954954    Bstr format = aNode.stringValue ("format");
    955     AssertReturn (!format.isNull(), E_FAIL);
     955    AssertReturn(!format.isNull(), E_FAIL);
    956956    rc = setFormat (format);
    957     CheckComRCReturnRC (rc);
     957    CheckComRCReturnRC(rc);
    958958
    959959    /* optional, only for diffs, default is false */
     
    979979    Bstr location = aNode.stringValue ("location");
    980980    rc = setLocation (location);
    981     CheckComRCReturnRC (rc);
     981    CheckComRCReturnRC(rc);
    982982
    983983    /* type is only for base hard disks */
     
    995995    }
    996996
    997     LogFlowThisFunc (("m.locationFull='%ls', mm.format=%ls, m.id={%RTuuid}\n",
     997    LogFlowThisFunc(("m.locationFull='%ls', mm.format=%ls, m.id={%RTuuid}\n",
    998998                      m.locationFull.raw(), mm.format.raw(), m.id.raw()));
    999999
     
    10201020
    10211021    /* Confirm a successful initialization when it's the case */
    1022     if (SUCCEEDED (rc))
     1022    if (SUCCEEDED(rc))
    10231023        autoInitSpan.setSucceeded();
    10241024
     
    10391039{
    10401040    /* Enclose the state transition Ready->InUninit->NotReady */
    1041     AutoUninitSpan autoUninitSpan (this);
     1041    AutoUninitSpan autoUninitSpan(this);
    10421042    if (autoUninitSpan.uninitDone())
    10431043        return;
     
    10751075    }
    10761076
    1077     unconst (mVirtualBox).setNull();
     1077    unconst(mVirtualBox).setNull();
    10781078}
    10791079
     
    10861086        return E_POINTER;
    10871087
    1088     AutoCaller autoCaller (this);
    1089     CheckComRCReturnRC (autoCaller.rc());
     1088    AutoCaller autoCaller(this);
     1089    CheckComRCReturnRC(autoCaller.rc());
    10901090
    10911091    /* no need to lock, mm.format is const */
    1092     mm.format.cloneTo (aFormat);
     1092    mm.format.cloneTo(aFormat);
    10931093
    10941094    return S_OK;
     
    11001100        return E_POINTER;
    11011101
    1102     AutoCaller autoCaller (this);
    1103     CheckComRCReturnRC (autoCaller.rc());
    1104 
    1105     AutoReadLock alock (this);
     1102    AutoCaller autoCaller(this);
     1103    CheckComRCReturnRC(autoCaller.rc());
     1104
     1105    AutoReadLock alock(this);
    11061106
    11071107    *aType = mm.type;
     
    11121112STDMETHODIMP HardDisk::COMSETTER(Type) (HardDiskType_T aType)
    11131113{
    1114     AutoCaller autoCaller (this);
    1115     CheckComRCReturnRC (autoCaller.rc());
     1114    AutoCaller autoCaller(this);
     1115    CheckComRCReturnRC(autoCaller.rc());
    11161116
    11171117    /* VirtualBox::saveSettings() needs a write lock */
     
    11831183        return E_POINTER;
    11841184
    1185     AutoCaller autoCaller (this);
    1186     CheckComRCReturnRC (autoCaller.rc());
     1185    AutoCaller autoCaller(this);
     1186    CheckComRCReturnRC(autoCaller.rc());
    11871187
    11881188    /* we access mParent */
    11891189    AutoReadLock treeLock (this->treeLock());
    11901190
    1191     mParent.queryInterfaceTo (aParent);
     1191    mParent.queryInterfaceTo(aParent);
    11921192
    11931193    return S_OK;
    11941194}
    11951195
    1196 STDMETHODIMP HardDisk::COMGETTER(Children) (ComSafeArrayOut (IHardDisk *, aChildren))
    1197 {
    1198     if (ComSafeArrayOutIsNull (aChildren))
     1196STDMETHODIMP HardDisk::COMGETTER(Children) (ComSafeArrayOut(IHardDisk *, aChildren))
     1197{
     1198    if (ComSafeArrayOutIsNull(aChildren))
    11991199        return E_POINTER;
    12001200
    1201     AutoCaller autoCaller (this);
    1202     CheckComRCReturnRC (autoCaller.rc());
     1201    AutoCaller autoCaller(this);
     1202    CheckComRCReturnRC(autoCaller.rc());
    12031203
    12041204    /* we access children */
     
    12061206
    12071207    SafeIfaceArray<IHardDisk> children (this->children());
    1208     children.detachTo (ComSafeArrayOutArg (aChildren));
     1208    children.detachTo(ComSafeArrayOutArg(aChildren));
    12091209
    12101210    return S_OK;
     
    12181218    /* root() will do callers/locking */
    12191219
    1220     root().queryInterfaceTo (aRoot);
     1220    root().queryInterfaceTo(aRoot);
    12211221
    12221222    return S_OK;
     
    12281228        return E_POINTER;
    12291229
    1230     AutoCaller autoCaller (this);
    1231     CheckComRCReturnRC (autoCaller.rc());
     1230    AutoCaller autoCaller(this);
     1231    CheckComRCReturnRC(autoCaller.rc());
    12321232
    12331233    /* isRadOnly() will do locking */
     
    12401240STDMETHODIMP HardDisk::COMGETTER(LogicalSize) (ULONG64 *aLogicalSize)
    12411241{
    1242     CheckComArgOutPointerValid (aLogicalSize);
    1243 
    1244     {
    1245         AutoCaller autoCaller (this);
    1246         CheckComRCReturnRC (autoCaller.rc());
    1247 
    1248         AutoReadLock alock (this);
     1242    CheckComArgOutPointerValid(aLogicalSize);
     1243
     1244    {
     1245        AutoCaller autoCaller(this);
     1246        CheckComRCReturnRC(autoCaller.rc());
     1247
     1248        AutoReadLock alock(this);
    12491249
    12501250        /* we access mParent */
     
    12701270STDMETHODIMP HardDisk::COMGETTER(AutoReset) (BOOL *aAutoReset)
    12711271{
    1272     CheckComArgOutPointerValid (aAutoReset);
    1273 
    1274     AutoCaller autoCaller (this);
    1275     CheckComRCReturnRC (autoCaller.rc());
    1276 
    1277     AutoReadLock alock (this);
     1272    CheckComArgOutPointerValid(aAutoReset);
     1273
     1274    AutoCaller autoCaller(this);
     1275    CheckComRCReturnRC(autoCaller.rc());
     1276
     1277    AutoReadLock alock(this);
    12781278
    12791279    if (mParent.isNull())
     
    12871287STDMETHODIMP HardDisk::COMSETTER(AutoReset) (BOOL aAutoReset)
    12881288{
    1289     AutoCaller autoCaller (this);
    1290     CheckComRCReturnRC (autoCaller.rc());
     1289    AutoCaller autoCaller(this);
     1290    CheckComRCReturnRC(autoCaller.rc());
    12911291
    12921292    /* VirtualBox::saveSettings() needs a write lock */
     
    13141314{
    13151315    CheckComArgStrNotEmptyOrNull (aName);
    1316     CheckComArgOutPointerValid (aValue);
    1317 
    1318     AutoCaller autoCaller (this);
    1319     CheckComRCReturnRC (autoCaller.rc());
    1320 
    1321     AutoReadLock alock (this);
     1316    CheckComArgOutPointerValid(aValue);
     1317
     1318    AutoCaller autoCaller(this);
     1319    CheckComRCReturnRC(autoCaller.rc());
     1320
     1321    AutoReadLock alock(this);
    13221322
    13231323    Data::PropertyMap::const_iterator it = mm.properties.find (Bstr (aName));
     
    13271327
    13281328    if (it->second.isEmpty())
    1329         Bstr("").cloneTo (aValue);
     1329        Bstr("").cloneTo(aValue);
    13301330    else
    1331         it->second.cloneTo (aValue);
     1331        it->second.cloneTo(aValue);
    13321332
    13331333    return S_OK;
     
    13381338    CheckComArgStrNotEmptyOrNull (aName);
    13391339
    1340     AutoCaller autoCaller (this);
    1341     CheckComRCReturnRC (autoCaller.rc());
     1340    AutoCaller autoCaller(this);
     1341    CheckComRCReturnRC(autoCaller.rc());
    13421342
    13431343    /* VirtualBox::saveSettings() needs a write lock */
     
    13691369
    13701370STDMETHODIMP HardDisk::GetProperties(IN_BSTR aNames,
    1371                                      ComSafeArrayOut (BSTR, aReturnNames),
    1372                                      ComSafeArrayOut (BSTR, aReturnValues))
    1373 {
    1374     CheckComArgOutSafeArrayPointerValid (aReturnNames);
    1375     CheckComArgOutSafeArrayPointerValid (aReturnValues);
    1376 
    1377     AutoCaller autoCaller (this);
    1378     CheckComRCReturnRC (autoCaller.rc());
    1379 
    1380     AutoReadLock alock (this);
     1371                                     ComSafeArrayOut(BSTR, aReturnNames),
     1372                                     ComSafeArrayOut(BSTR, aReturnValues))
     1373{
     1374    CheckComArgOutSafeArrayPointerValid(aReturnNames);
     1375    CheckComArgOutSafeArrayPointerValid(aReturnValues);
     1376
     1377    AutoCaller autoCaller(this);
     1378    CheckComRCReturnRC(autoCaller.rc());
     1379
     1380    AutoReadLock alock(this);
    13811381
    13821382    /// @todo make use of aNames according to the documentation
    13831383    NOREF (aNames);
    13841384
    1385     com::SafeArray <BSTR> names (mm.properties.size());
    1386     com::SafeArray <BSTR> values (mm.properties.size());
     1385    com::SafeArray<BSTR> names (mm.properties.size());
     1386    com::SafeArray<BSTR> values (mm.properties.size());
    13871387    size_t i = 0;
    13881388
     
    13901390          it != mm.properties.end(); ++ it)
    13911391    {
    1392         it->first.cloneTo (&names [i]);
     1392        it->first.cloneTo(&names [i]);
    13931393        if (it->second.isEmpty())
    13941394            Bstr("").cloneTo(&values [i]);
    13951395        else
    1396             it->second.cloneTo (&values [i]);
     1396            it->second.cloneTo(&values [i]);
    13971397        ++ i;
    13981398    }
    13991399
    1400     names.detachTo (ComSafeArrayOutArg (aReturnNames));
    1401     values.detachTo (ComSafeArrayOutArg (aReturnValues));
     1400    names.detachTo(ComSafeArrayOutArg(aReturnNames));
     1401    values.detachTo(ComSafeArrayOutArg(aReturnValues));
    14021402
    14031403    return S_OK;
     
    14101410    CheckComArgSafeArrayNotNull (aValues);
    14111411
    1412     AutoCaller autoCaller (this);
    1413     CheckComRCReturnRC (autoCaller.rc());
     1412    AutoCaller autoCaller(this);
     1413    CheckComRCReturnRC(autoCaller.rc());
    14141414
    14151415    /* VirtualBox::saveSettings() needs a write lock */
    14161416    AutoMultiWriteLock2 alock (mVirtualBox, this);
    14171417
    1418     com::SafeArray <IN_BSTR> names (ComSafeArrayInArg (aNames));
    1419     com::SafeArray <IN_BSTR> values (ComSafeArrayInArg (aValues));
     1418    com::SafeArray<IN_BSTR> names (ComSafeArrayInArg (aNames));
     1419    com::SafeArray<IN_BSTR> values (ComSafeArrayInArg (aValues));
    14201420
    14211421    /* first pass: validate names */
     
    14311431    {
    14321432        Data::PropertyMap::iterator it = mm.properties.find (Bstr (names [i]));
    1433         AssertReturn (it != mm.properties.end(), E_FAIL);
     1433        AssertReturn(it != mm.properties.end(), E_FAIL);
    14341434
    14351435        if (values[i] && !*values[i])
     
    14481448                                         IProgress **aProgress)
    14491449{
    1450     CheckComArgOutPointerValid (aProgress);
    1451 
    1452     AutoCaller autoCaller (this);
    1453     CheckComRCReturnRC (autoCaller.rc());
    1454 
    1455     AutoWriteLock alock (this);
     1450    CheckComArgOutPointerValid(aProgress);
     1451
     1452    AutoCaller autoCaller(this);
     1453    CheckComRCReturnRC(autoCaller.rc());
     1454
     1455    AutoWriteLock alock(this);
    14561456
    14571457    aVariant = (HardDiskVariant_T)((unsigned)aVariant & (unsigned)~HardDiskVariant_Diff);
     
    14751475    }
    14761476
    1477     ComObjPtr <Progress> progress;
     1477    ComObjPtr<Progress> progress;
    14781478    progress.createObject();
    14791479    /// @todo include fixed/dynamic
     
    14831483          : BstrFmt (tr ("Creating dynamic hard disk storage unit '%ls'"), m.locationFull.raw()),
    14841484        TRUE /* aCancelable */);
    1485     CheckComRCReturnRC (rc);
     1485    CheckComRCReturnRC(rc);
    14861486
    14871487    /* setup task object and thread to carry out the operation
     
    14891489
    14901490    std::auto_ptr <Task> task (new Task (this, progress, Task::CreateBase));
    1491     AssertComRCReturnRC (task->autoCaller.rc());
     1491    AssertComRCReturnRC(task->autoCaller.rc());
    14921492
    14931493    task->d.size = aLogicalSize;
     
    14951495
    14961496    rc = task->startThread();
    1497     CheckComRCReturnRC (rc);
     1497    CheckComRCReturnRC(rc);
    14981498
    14991499    /* go to Creating state on success */
     
    15041504
    15051505    /* return progress to the caller */
    1506     progress.queryInterfaceTo (aProgress);
     1506    progress.queryInterfaceTo(aProgress);
    15071507
    15081508    return S_OK;
     
    15111511STDMETHODIMP HardDisk::DeleteStorage (IProgress **aProgress)
    15121512{
    1513     CheckComArgOutPointerValid (aProgress);
    1514 
    1515     AutoCaller autoCaller (this);
    1516     CheckComRCReturnRC (autoCaller.rc());
    1517 
    1518     ComObjPtr <Progress> progress;
     1513    CheckComArgOutPointerValid(aProgress);
     1514
     1515    AutoCaller autoCaller(this);
     1516    CheckComRCReturnRC(autoCaller.rc());
     1517
     1518    ComObjPtr<Progress> progress;
    15191519
    15201520    HRESULT rc = deleteStorageNoWait (progress);
    1521     if (SUCCEEDED (rc))
     1521    if (SUCCEEDED(rc))
    15221522    {
    15231523        /* return progress to the caller */
    1524         progress.queryInterfaceTo (aProgress);
     1524        progress.queryInterfaceTo(aProgress);
    15251525    }
    15261526
     
    15331533{
    15341534    CheckComArgNotNull (aTarget);
    1535     CheckComArgOutPointerValid (aProgress);
    1536 
    1537     AutoCaller autoCaller (this);
    1538     CheckComRCReturnRC (autoCaller.rc());
     1535    CheckComArgOutPointerValid(aProgress);
     1536
     1537    AutoCaller autoCaller(this);
     1538    CheckComRCReturnRC(autoCaller.rc());
    15391539
    15401540    ComObjPtr<HardDisk> diff;
    15411541    HRESULT rc = mVirtualBox->cast (aTarget, diff);
    1542     CheckComRCReturnRC (rc);
    1543 
    1544     AutoWriteLock alock (this);
     1542    CheckComRCReturnRC(rc);
     1543
     1544    AutoWriteLock alock(this);
    15451545
    15461546    if (mm.type == HardDiskType_Writethrough)
     
    15521552     * created */
    15531553    rc = LockRead (NULL);
    1554     CheckComRCReturnRC (rc);
    1555 
    1556     ComObjPtr <Progress> progress;
     1554    CheckComRCReturnRC(rc);
     1555
     1556    ComObjPtr<Progress> progress;
    15571557
    15581558    rc = createDiffStorageNoWait (diff, aVariant, progress);
     
    15661566    {
    15671567        /* return progress to the caller */
    1568         progress.queryInterfaceTo (aProgress);
     1568        progress.queryInterfaceTo(aProgress);
    15691569    }
    15701570
     
    15741574STDMETHODIMP HardDisk::MergeTo (IN_BSTR /* aTargetId */, IProgress ** /* aProgress */)
    15751575{
    1576     AutoCaller autoCaller (this);
    1577     CheckComRCReturnRC (autoCaller.rc());
     1576    AutoCaller autoCaller(this);
     1577    CheckComRCReturnRC(autoCaller.rc());
    15781578
    15791579    ReturnComNotImplemented();
     
    15861586{
    15871587    CheckComArgNotNull (aTarget);
    1588     CheckComArgOutPointerValid (aProgress);
    1589 
    1590     AutoCaller autoCaller (this);
    1591     CheckComRCReturnRC (autoCaller.rc());
    1592 
    1593     ComObjPtr <HardDisk> target;
     1588    CheckComArgOutPointerValid(aProgress);
     1589
     1590    AutoCaller autoCaller(this);
     1591    CheckComRCReturnRC(autoCaller.rc());
     1592
     1593    ComObjPtr<HardDisk> target;
    15941594    HRESULT rc = mVirtualBox->cast (aTarget, target);
    1595     CheckComRCReturnRC (rc);
    1596     ComObjPtr <HardDisk> parent;
     1595    CheckComRCReturnRC(rc);
     1596    ComObjPtr<HardDisk> parent;
    15971597    if (aParent)
    15981598    {
    15991599        rc = mVirtualBox->cast (aParent, parent);
    1600         CheckComRCReturnRC (rc);
     1600        CheckComRCReturnRC(rc);
    16011601    }
    16021602
    16031603    AutoMultiWriteLock3 alock (this, target, parent);
    16041604
    1605     ComObjPtr <Progress> progress;
     1605    ComObjPtr<Progress> progress;
    16061606
    16071607    try
     
    16891689    }
    16901690
    1691     if (SUCCEEDED (rc))
     1691    if (SUCCEEDED(rc))
    16921692    {
    16931693        /* return progress to the caller */
    1694         progress.queryInterfaceTo (aProgress);
     1694        progress.queryInterfaceTo(aProgress);
    16951695    }
    16961696
     
    17001700STDMETHODIMP HardDisk::Compact (IProgress **aProgress)
    17011701{
    1702     CheckComArgOutPointerValid (aProgress);
    1703 
    1704     AutoCaller autoCaller (this);
    1705     CheckComRCReturnRC (autoCaller.rc());
    1706 
    1707     AutoWriteLock alock (this);
    1708 
    1709     ComObjPtr <Progress> progress;
     1702    CheckComArgOutPointerValid(aProgress);
     1703
     1704    AutoCaller autoCaller(this);
     1705    CheckComRCReturnRC(autoCaller.rc());
     1706
     1707    AutoWriteLock alock(this);
     1708
     1709    ComObjPtr<Progress> progress;
    17101710
    17111711    HRESULT rc = S_OK;
     
    17551755    }
    17561756
    1757     if (SUCCEEDED (rc))
     1757    if (SUCCEEDED(rc))
    17581758    {
    17591759        /* return progress to the caller */
    1760         progress.queryInterfaceTo (aProgress);
     1760        progress.queryInterfaceTo(aProgress);
    17611761    }
    17621762
     
    17661766STDMETHODIMP HardDisk::Reset (IProgress **aProgress)
    17671767{
    1768     CheckComArgOutPointerValid (aProgress);
    1769 
    1770     AutoCaller autoCaller (this);
    1771     CheckComRCReturnRC (autoCaller.rc());
    1772 
    1773     AutoWriteLock alock (this);
     1768    CheckComArgOutPointerValid(aProgress);
     1769
     1770    AutoCaller autoCaller(this);
     1771    CheckComRCReturnRC(autoCaller.rc());
     1772
     1773    AutoWriteLock alock(this);
    17741774
    17751775    if (mParent.isNull())
     
    17791779
    17801780    HRESULT rc = canClose();
    1781     CheckComRCReturnRC (rc);
     1781    CheckComRCReturnRC(rc);
    17821782
    17831783    rc = LockWrite (NULL);
    1784     CheckComRCReturnRC (rc);
    1785 
    1786     ComObjPtr <Progress> progress;
     1784    CheckComRCReturnRC(rc);
     1785
     1786    ComObjPtr<Progress> progress;
    17871787
    17881788    try
     
    18211821    {
    18221822        /* return progress to the caller */
    1823         progress.queryInterfaceTo (aProgress);
     1823        progress.queryInterfaceTo(aProgress);
    18241824    }
    18251825
     
    18451845    AssertReturnVoid (aNewPath);
    18461846
    1847     AutoCaller autoCaller (this);
     1847    AutoCaller autoCaller(this);
    18481848    AssertComRCReturnVoid (autoCaller.rc());
    18491849
    1850     AutoWriteLock alock (this);
     1850    AutoWriteLock alock(this);
    18511851
    18521852    /* we access children() */
     
    18761876 * @note Locks treeLock() for reading.
    18771877 */
    1878 ComObjPtr <HardDisk> HardDisk::root (uint32_t *aLevel /*= NULL*/)
    1879 {
    1880     ComObjPtr <HardDisk> root;
     1878ComObjPtr<HardDisk> HardDisk::root (uint32_t *aLevel /*= NULL*/)
     1879{
     1880    ComObjPtr<HardDisk> root;
    18811881    uint32_t level;
    18821882
    1883     AutoCaller autoCaller (this);
    1884     AssertReturn (autoCaller.isOk(), root);
     1883    AutoCaller autoCaller(this);
     1884    AssertReturn(autoCaller.isOk(), root);
    18851885
    18861886    /* we access mParent */
     
    18951895        {
    18961896            AutoCaller rootCaller (root);
    1897             AssertReturn (rootCaller.isOk(), root);
     1897            AssertReturn(rootCaller.isOk(), root);
    18981898
    18991899            if (root->mParent.isNull())
     
    19201920bool HardDisk::isReadOnly()
    19211921{
    1922     AutoCaller autoCaller (this);
     1922    AutoCaller autoCaller(this);
    19231923    AssertComRCReturn (autoCaller.rc(), false);
    19241924
    1925     AutoReadLock alock (this);
     1925    AutoReadLock alock(this);
    19261926
    19271927    /* we access children */
     
    19691969    using namespace settings;
    19701970
    1971     AssertReturn (!aParentNode.isNull(), E_FAIL);
    1972 
    1973     AutoCaller autoCaller (this);
    1974     CheckComRCReturnRC (autoCaller.rc());
    1975 
    1976     AutoReadLock alock (this);
     1971    AssertReturn(!aParentNode.isNull(), E_FAIL);
     1972
     1973    AutoCaller autoCaller(this);
     1974    CheckComRCReturnRC(autoCaller.rc());
     1975
     1976    AutoReadLock alock(this);
    19771977
    19781978    /* we access mParent */
     
    20262026    {
    20272027        HRESULT rc = (*it)->saveSettings (diskNode);
    2028         AssertComRCReturnRC (rc);
     2028        AssertComRCReturnRC(rc);
    20292029    }
    20302030
     
    20462046HRESULT HardDisk::compareLocationTo (const char *aLocation, int &aResult)
    20472047{
    2048     AutoCaller autoCaller (this);
    2049     AssertComRCReturnRC (autoCaller.rc());
    2050 
    2051     AutoReadLock alock (this);
     2048    AutoCaller autoCaller(this);
     2049    AssertComRCReturnRC(autoCaller.rc());
     2050
     2051    AutoReadLock alock(this);
    20522052
    20532053    Utf8Str locationFull (m.locationFull);
     
    20702070
    20712071        int vrc = mVirtualBox->calculateFullPath (location, location);
    2072         if (RT_FAILURE (vrc))
     2072        if (RT_FAILURE(vrc))
    20732073            return setError (E_FAIL,
    20742074                tr ("Invalid hard disk storage file location '%s' (%Rrc)"),
     
    21202120HRESULT HardDisk::prepareDiscard (MergeChain * &aChain)
    21212121{
    2122     AutoCaller autoCaller (this);
    2123     AssertComRCReturnRC (autoCaller.rc());
     2122    AutoCaller autoCaller(this);
     2123    AssertComRCReturnRC(autoCaller.rc());
    21242124
    21252125    aChain = NULL;
    21262126
    2127     AutoWriteLock alock (this);
     2127    AutoWriteLock alock(this);
    21282128
    21292129    /* we access mParent & children() */
    21302130    AutoReadLock treeLock (this->treeLock());
    21312131
    2132     AssertReturn (mm.type == HardDiskType_Normal, E_FAIL);
     2132    AssertReturn(mm.type == HardDiskType_Normal, E_FAIL);
    21332133
    21342134    if (children().size() == 0)
     
    21702170     * time when discard() is called, there must be no any attachments at all
    21712171     * (the code calling prepareDiscard() should detach). */
    2172     AssertReturn (m.backRefs.size() == 1 &&
     2172    AssertReturn(m.backRefs.size() == 1 &&
    21732173                  !m.backRefs.front().inCurState &&
    21742174                  m.backRefs.front().snapshotIds.size() == 1, E_FAIL);
     
    22482248 *       reading or writing.
    22492249 */
    2250 HRESULT HardDisk::discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain)
    2251 {
    2252     AssertReturn (!aProgress.isNull(), E_FAIL);
    2253 
    2254     ComObjPtr <HardDisk> hdFrom;
     2250HRESULT HardDisk::discard (ComObjPtr<Progress> &aProgress, MergeChain *aChain)
     2251{
     2252    AssertReturn(!aProgress.isNull(), E_FAIL);
     2253
     2254    ComObjPtr<HardDisk> hdFrom;
    22552255
    22562256    HRESULT rc = S_OK;
    22572257
    22582258    {
    2259         AutoCaller autoCaller (this);
    2260         AssertComRCReturnRC (autoCaller.rc());
     2259        AutoCaller autoCaller(this);
     2260        AssertComRCReturnRC(autoCaller.rc());
    22612261
    22622262        aProgress->setNextOperation(BstrFmt(tr("Discarding hard disk '%s'"), name().raw()),
     
    22652265        if (aChain == NULL)
    22662266        {
    2267             AutoWriteLock alock (this);
     2267            AutoWriteLock alock(this);
    22682268
    22692269            /* we access mParent & children() */
     
    23002300    }
    23012301
    2302     if (SUCCEEDED (rc))
     2302    if (SUCCEEDED(rc))
    23032303    {
    23042304        /* mergeToAndWait() cannot uninitialize the initiator because of
     
    23232323void HardDisk::cancelDiscard (MergeChain *aChain)
    23242324{
    2325     AutoCaller autoCaller (this);
     2325    AutoCaller autoCaller(this);
    23262326    AssertComRCReturnVoid (autoCaller.rc());
    23272327
    23282328    if (aChain == NULL)
    23292329    {
    2330         AutoWriteLock alock (this);
     2330        AutoWriteLock alock(this);
    23312331
    23322332        /* we access mParent & children() */
     
    23642364    Bstr format;
    23652365
    2366     AutoCaller autoCaller (this);
     2366    AutoCaller autoCaller(this);
    23672367    AssertComRCReturn (autoCaller.rc(), format);
    23682368
     
    24062406 *       writing.
    24072407 */
    2408 HRESULT HardDisk::deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait)
    2409 {
    2410     AssertReturn (aProgress != NULL || aWait == true, E_FAIL);
     2408HRESULT HardDisk::deleteStorage (ComObjPtr<Progress> *aProgress, bool aWait)
     2409{
     2410    AssertReturn(aProgress != NULL || aWait == true, E_FAIL);
    24112411
    24122412    /* unregisterWithVirtualBox() needs a write lock. We want to unregister
     
    24182418    AutoWriteLock vboxLock (mVirtualBox);
    24192419
    2420     AutoWriteLock alock (this);
     2420    AutoWriteLock alock(this);
    24212421
    24222422    if (!(mm.formatObj->capabilities() &
     
    24492449
    24502450    HRESULT rc = canClose();
    2451     CheckComRCReturnRC (rc);
     2451    CheckComRCReturnRC(rc);
    24522452
    24532453    /* go to Deleting state before leaving the lock */
     
    24702470    m.state = MediaState_Created;
    24712471
    2472     CheckComRCReturnRC (rc);
    2473 
    2474     ComObjPtr <Progress> progress;
     2472    CheckComRCReturnRC(rc);
     2473
     2474    ComObjPtr<Progress> progress;
    24752475
    24762476    if (aProgress != NULL)
     
    24872487                         m.locationFull.raw()),
    24882488                FALSE /* aCancelable */);
    2489             CheckComRCReturnRC (rc);
     2489            CheckComRCReturnRC(rc);
    24902490        }
    24912491    }
    24922492
    24932493    std::auto_ptr <Task> task (new Task (this, progress, Task::Delete));
    2494     AssertComRCReturnRC (task->autoCaller.rc());
     2494    AssertComRCReturnRC(task->autoCaller.rc());
    24952495
    24962496    if (aWait)
     
    25042504    {
    25052505        rc = task->startThread();
    2506         CheckComRCReturnRC (rc);
     2506        CheckComRCReturnRC(rc);
    25072507
    25082508        /* go to Deleting state before leaving the lock */
     
    25622562                                    bool aWait)
    25632563{
    2564     AssertReturn (!aTarget.isNull(), E_FAIL);
    2565     AssertReturn (aProgress != NULL || aWait == true, E_FAIL);
    2566 
    2567     AutoCaller autoCaller (this);
    2568     CheckComRCReturnRC (autoCaller.rc());
     2564    AssertReturn(!aTarget.isNull(), E_FAIL);
     2565    AssertReturn(aProgress != NULL || aWait == true, E_FAIL);
     2566
     2567    AutoCaller autoCaller(this);
     2568    CheckComRCReturnRC(autoCaller.rc());
    25692569
    25702570    AutoCaller targetCaller (aTarget);
    2571     CheckComRCReturnRC (targetCaller.rc());
     2571    CheckComRCReturnRC(targetCaller.rc());
    25722572
    25732573    AutoMultiWriteLock2 alock (this, aTarget);
    25742574
    2575     AssertReturn (mm.type != HardDiskType_Writethrough, E_FAIL);
     2575    AssertReturn(mm.type != HardDiskType_Writethrough, E_FAIL);
    25762576
    25772577    /* Note: MediaState_LockedWrite is ok when taking an online snapshot */
    2578     AssertReturn (m.state == MediaState_LockedRead ||
     2578    AssertReturn(m.state == MediaState_LockedRead ||
    25792579                  m.state == MediaState_LockedWrite, E_FAIL);
    25802580
     
    26102610    }
    26112611
    2612     ComObjPtr <Progress> progress;
     2612    ComObjPtr<Progress> progress;
    26132613
    26142614    if (aProgress != NULL)
     
    26252625                         aTarget->m.locationFull.raw()),
    26262626                TRUE /* aCancelable */);
    2627             CheckComRCReturnRC (rc);
     2627            CheckComRCReturnRC(rc);
    26282628        }
    26292629    }
     
    26332633
    26342634    std::auto_ptr <Task> task (new Task (this, progress, Task::CreateDiff));
    2635     AssertComRCReturnRC (task->autoCaller.rc());
     2635    AssertComRCReturnRC(task->autoCaller.rc());
    26362636
    26372637    task->setData (aTarget);
     
    26522652    {
    26532653        rc = task->startThread();
    2654         CheckComRCReturnRC (rc);
     2654        CheckComRCReturnRC(rc);
    26552655
    26562656        /* go to Creating state before leaving the lock */
     
    26972697                                 bool aIgnoreAttachments /*= false*/)
    26982698{
    2699     AssertReturn (aTarget != NULL, E_FAIL);
    2700 
    2701     AutoCaller autoCaller (this);
    2702     AssertComRCReturnRC (autoCaller.rc());
     2699    AssertReturn(aTarget != NULL, E_FAIL);
     2700
     2701    AutoCaller autoCaller(this);
     2702    AssertComRCReturnRC(autoCaller.rc());
    27032703
    27042704    AutoCaller targetCaller (aTarget);
    2705     AssertComRCReturnRC (targetCaller.rc());
     2705    AssertComRCReturnRC(targetCaller.rc());
    27062706
    27072707    aChain = NULL;
     
    27312731                Bstr tgtLoc;
    27322732                {
    2733                     AutoReadLock alock (this);
     2733                    AutoReadLock alock(this);
    27342734                    tgtLoc = aTarget->locationFull();
    27352735                }
    27362736
    2737                 AutoReadLock alock (this);
     2737                AutoReadLock alock(this);
    27382738                return setError (E_FAIL,
    27392739                    tr ("Hard disks '%ls' and '%ls' are unrelated"),
     
    27582758            else
    27592759                rc = chain->addIntermediate (last);
    2760             CheckComRCReturnRC (rc);
     2760            CheckComRCReturnRC(rc);
    27612761
    27622762            if (last == first)
     
    28432843 */
    28442844HRESULT HardDisk::mergeTo(MergeChain *aChain,
    2845                           ComObjPtr <Progress> *aProgress,
     2845                          ComObjPtr<Progress> *aProgress,
    28462846                          bool aWait)
    28472847{
    2848     AssertReturn (aChain != NULL, E_FAIL);
    2849     AssertReturn (aProgress != NULL || aWait == true, E_FAIL);
    2850 
    2851     AutoCaller autoCaller (this);
    2852     CheckComRCReturnRC (autoCaller.rc());
     2848    AssertReturn(aChain != NULL, E_FAIL);
     2849    AssertReturn(aProgress != NULL || aWait == true, E_FAIL);
     2850
     2851    AutoCaller autoCaller(this);
     2852    CheckComRCReturnRC(autoCaller.rc());
    28532853
    28542854    HRESULT rc = S_OK;
    28552855
    2856     ComObjPtr <Progress> progress;
     2856    ComObjPtr<Progress> progress;
    28572857
    28582858    if (aProgress != NULL)
     
    28642864        if (progress.isNull())
    28652865        {
    2866             AutoReadLock alock (this);
     2866            AutoReadLock alock(this);
    28672867
    28682868            progress.createObject();
     
    28712871                         name().raw(), aChain->target()->name().raw()),
    28722872                TRUE /* aCancelable */);
    2873             CheckComRCReturnRC (rc);
     2873            CheckComRCReturnRC(rc);
    28742874        }
    28752875    }
     
    28792879
    28802880    std::auto_ptr <Task> task (new Task (this, progress, Task::Merge));
    2881     AssertComRCReturnRC (task->autoCaller.rc());
     2881    AssertComRCReturnRC(task->autoCaller.rc());
    28822882
    28832883    task->setData (aChain);
     
    28952895    {
    28962896        rc = task->startThread();
    2897         CheckComRCReturnRC (rc);
     2897        CheckComRCReturnRC(rc);
    28982898    }
    28992899
     
    29202920void HardDisk::cancelMergeTo (MergeChain *aChain)
    29212921{
    2922     AutoCaller autoCaller (this);
     2922    AutoCaller autoCaller(this);
    29232923    AssertComRCReturnVoid (autoCaller.rc());
    29242924
     
    29582958    CheckComArgStrNotEmptyOrNull (aLocation);
    29592959
    2960     AutoCaller autoCaller (this);
    2961     AssertComRCReturnRC (autoCaller.rc());
     2960    AutoCaller autoCaller(this);
     2961    AssertComRCReturnRC(autoCaller.rc());
    29622962
    29632963    /* formatObj may be null only when initializing from an existing path and
    29642964     * no format is known yet */
    2965     AssertReturn ((!mm.format.isNull() && !mm.formatObj.isNull()) ||
     2965    AssertReturn((!mm.format.isNull() && !mm.formatObj.isNull()) ||
    29662966                  (autoCaller.state() == InInit &&
    29672967                   m.state != MediaState_NotCreated && m.id.isEmpty() &&
     
    30203020        Utf8Str locationFull;
    30213021        int vrc = mVirtualBox->calculateFullPath (location, locationFull);
    3022         if (RT_FAILURE (vrc))
     3022        if (RT_FAILURE(vrc))
    30233023            return setError (VBOX_E_FILE_ERROR,
    30243024                tr ("Invalid hard disk storage file location '%s' (%Rrc)"),
     
    30343034                RTFILE file;
    30353035                vrc = RTFileOpen (&file, locationFull, RTFILE_O_READ);
    3036                 if (RT_SUCCESS (vrc))
     3036                if (RT_SUCCESS(vrc))
    30373037                    RTFileClose (file);
    30383038            }
    3039             if (RT_SUCCESS (vrc))
     3039            if (RT_SUCCESS(vrc))
    30403040            {
    30413041                vrc = VDGetFormat (locationFull, &backendName);
     
    30483048            }
    30493049
    3050             if (RT_FAILURE (vrc))
     3050            if (RT_FAILURE(vrc))
    30513051            {
    30523052                if (vrc == VERR_FILE_NOT_FOUND || vrc == VERR_PATH_NOT_FOUND)
     
    30673067            /* setFormat() must not fail since we've just used the backend so
    30683068             * the format object must be there */
    3069             AssertComRCReturnRC (rc);
     3069            AssertComRCReturnRC(rc);
    30703070        }
    30713071
     
    30823082                 * also do that if we didn't generate it to make sure it is
    30833083                 * either generated by us or reset to null */
    3084                 unconst (m.id) = id;
     3084                unconst(m.id) = id;
    30853085            }
    30863086        }
     
    31153115        AutoReadLock propsLock (mVirtualBox->systemProperties());
    31163116
    3117         unconst (mm.formatObj)
     3117        unconst(mm.formatObj)
    31183118            = mVirtualBox->systemProperties()->hardDiskFormat (aFormat);
    31193119        if (mm.formatObj.isNull())
     
    31243124         * uninitialization */
    31253125        HRESULT rc = mm.formatObj->addCaller();
    3126         AssertComRCReturnRC (rc);
     3126        AssertComRCReturnRC(rc);
    31273127
    31283128        /* get properties (preinsert them as keys in the map). Note that the
     
    31413141    }
    31423142
    3143     unconst (mm.format) = aFormat;
     3143    unconst(mm.format) = aFormat;
    31443144
    31453145    return S_OK;
     
    31643164HRESULT HardDisk::queryInfo()
    31653165{
    3166     AutoWriteLock alock (this);
    3167 
    3168     AssertReturn (m.state == MediaState_Created ||
     3166    AutoWriteLock alock(this);
     3167
     3168    AssertReturn(m.state == MediaState_Created ||
    31693169                  m.state == MediaState_Inaccessible ||
    31703170                  m.state == MediaState_LockedRead ||
     
    32573257                         flags,
    32583258                         mm.vdDiskIfaces);
    3259             if (RT_FAILURE (vrc))
     3259            if (RT_FAILURE(vrc))
    32603260            {
    32613261                lastAccessError = Utf8StrFmt (
     
    35173517    const ComObjPtr<HardDisk, ComWeakRef> parent = mParent;
    35183518
    3519     AssertReturn (children().size() == 0, E_FAIL);
     3519    AssertReturn(children().size() == 0, E_FAIL);
    35203520
    35213521    if (!mParent.isNull())
     
    36233623{
    36243624    HardDisk *that = static_cast<HardDisk*>(pvUser);
    3625     AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
     3625    AssertReturn(that != NULL, VERR_GENERAL_FAILURE);
    36263626
    36273627    if (that->mm.vdProgress != NULL)
     
    36473647{
    36483648    HardDisk *that = static_cast<HardDisk*>(pvUser);
    3649     AssertReturn (that != NULL, false);
     3649    AssertReturn(that != NULL, false);
    36503650
    36513651    /* we always return true since the only keys we have are those found in
     
    36583658                                              size_t *pcbValue)
    36593659{
    3660     AssertReturn (VALID_PTR (pcbValue), VERR_INVALID_POINTER);
     3660    AssertReturn(VALID_PTR (pcbValue), VERR_INVALID_POINTER);
    36613661
    36623662    HardDisk *that = static_cast<HardDisk*>(pvUser);
    3663     AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
     3663    AssertReturn(that != NULL, VERR_GENERAL_FAILURE);
    36643664
    36653665    Data::PropertyMap::const_iterator it =
     
    36813681                                            char *pszValue, size_t cchValue)
    36823682{
    3683     AssertReturn (VALID_PTR (pszValue), VERR_INVALID_POINTER);
     3683    AssertReturn(VALID_PTR (pszValue), VERR_INVALID_POINTER);
    36843684
    36853685    HardDisk *that = static_cast<HardDisk*>(pvUser);
    3686     AssertReturn (that != NULL, VERR_GENERAL_FAILURE);
     3686    AssertReturn(that != NULL, VERR_GENERAL_FAILURE);
    36873687
    36883688    Data::PropertyMap::const_iterator it =
     
    37163716{
    37173717    std::auto_ptr <Task> task (static_cast <Task *> (pvUser));
    3718     AssertReturn (task.get(), VERR_GENERAL_FAILURE);
     3718    AssertReturn(task.get(), VERR_GENERAL_FAILURE);
    37193719
    37203720    bool isAsync = thread != NIL_RTTHREAD;
     
    37533753                id.create();
    37543754                /* VirtualBox::registerHardDisk() will need UUID */
    3755                 unconst (that->m.id) = id;
     3755                unconst(that->m.id) = id;
    37563756            }
    37573757
     
    37883788                                        NULL, that->mm.vdDiskIfaces);
    37893789
    3790                     if (RT_FAILURE (vrc))
     3790                    if (RT_FAILURE(vrc))
    37913791                    {
    37923792                        throw setError (E_FAIL,
     
    38043804            catch (HRESULT aRC) { rc = aRC; }
    38053805
    3806             if (SUCCEEDED (rc))
     3806            if (SUCCEEDED(rc))
    38073807            {
    38083808                /* register with mVirtualBox as the last step and move to
     
    38143814            thatLock.maybeEnter();
    38153815
    3816             if (SUCCEEDED (rc))
     3816            if (SUCCEEDED(rc))
    38173817            {
    38183818                that->m.state = MediaState_Created;
     
    38283828                /* reset UUID to prevent it from being reused next time */
    38293829                if (generateUuid)
    3830                     unconst (that->m.id).clear();
     3830                    unconst(that->m.id).clear();
    38313831            }
    38323832
     
    38553855                targetId.create();
    38563856                /* VirtualBox::registerHardDisk() will need UUID */
    3857                 unconst (target->m.id) = targetId;
     3857                unconst(target->m.id) = targetId;
    38583858            }
    38593859
     
    38863886                                  VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO,
    38873887                                  that->mm.vdDiskIfaces);
    3888                     if (RT_FAILURE (vrc))
     3888                    if (RT_FAILURE(vrc))
    38893889                    {
    38903890                        throw setError (E_FAIL,
     
    39123912                    that->mm.vdProgress = NULL;
    39133913
    3914                     if (RT_FAILURE (vrc))
     3914                    if (RT_FAILURE(vrc))
    39153915                    {
    39163916                        throw setError (E_FAIL,
     
    39283928            catch (HRESULT aRC) { rc = aRC; }
    39293929
    3930             if (SUCCEEDED (rc))
     3930            if (SUCCEEDED(rc))
    39313931            {
    39323932                /* we set mParent & children() (note that thatLock is released
     
    39643964            thatLock.maybeEnter();
    39653965
    3966             if (SUCCEEDED (rc))
     3966            if (SUCCEEDED(rc))
    39673967            {
    39683968                target->m.state = MediaState_Created;
     
    39803980                /* reset UUID to prevent it from being reused next time */
    39813981                if (generateUuid)
    3982                     unconst (target->m.id).clear();
     3982                    unconst(target->m.id).clear();
    39833983            }
    39843984
     
    40624062                                          VD_OPEN_FLAGS_INFO : 0,
    40634063                                      (*it)->mm.vdDiskIfaces);
    4064                         if (RT_FAILURE (vrc))
     4064                        if (RT_FAILURE(vrc))
    40654065                            throw vrc;
    40664066#if 0
     
    40844084                    that->mm.vdProgress = NULL;
    40854085
    4086                     if (RT_FAILURE (vrc))
     4086                    if (RT_FAILURE(vrc))
    40874087                        throw vrc;
    40884088
     
    40954095                         * is the only image in the container on success) */
    40964096                        vrc = VDSetParentUuid (hdd, 0, chain->parent()->m.id);
    4097                         if (RT_FAILURE (vrc))
     4097                        if (RT_FAILURE(vrc))
    40984098                            throw vrc;
    40994099                    }
     
    41134113                                              VD_OPEN_FLAGS_INFO,
    41144114                                              (*it)->mm.vdDiskIfaces);
    4115                                 if (RT_FAILURE (vrc))
     4115                                if (RT_FAILURE(vrc))
    41164116                                    throw vrc;
    41174117
    41184118                                vrc = VDSetParentUuid (hdd, 1,
    41194119                                                       chain->target()->m.id);
    4120                                 if (RT_FAILURE (vrc))
     4120                                if (RT_FAILURE(vrc))
    41214121                                    throw vrc;
    41224122
    41234123                                vrc = VDClose (hdd, false /* fDelete */);
    4124                                 if (RT_FAILURE (vrc))
     4124                                if (RT_FAILURE(vrc))
    41254125                                    throw vrc;
    41264126                            }
     
    41464146            bool saveSettingsFailed = false;
    41474147
    4148             if (SUCCEEDED (rc))
     4148            if (SUCCEEDED(rc))
    41494149            {
    41504150                /* all hard disks but the target were successfully deleted by
     
    42214221                rc = that->mVirtualBox->saveSettings();
    42224222
    4223                 if (SUCCEEDED (rc))
     4223                if (SUCCEEDED(rc))
    42244224                {
    42254225                    /* unregister and uninitialize all hard disks in the chain
     
    43304330                targetId.create();
    43314331                /* VirtualBox::registerHardDisk() will need UUID */
    4332                 unconst (target->m.id) = targetId;
     4332                unconst(target->m.id) = targetId;
    43334333            }
    43344334
     
    43534353                                      VD_OPEN_FLAGS_READONLY,
    43544354                                      (*it)->mm.vdDiskIfaces);
    4355                         if (RT_FAILURE (vrc))
     4355                        if (RT_FAILURE(vrc))
    43564356                        {
    43574357                            throw setError (E_FAIL,
     
    43994399                                          ((*it)->m.state == MediaState_LockedWrite) ? VD_OPEN_FLAGS_NORMAL : VD_OPEN_FLAGS_READONLY,
    44004400                                          (*it)->mm.vdDiskIfaces);
    4401                             if (RT_FAILURE (vrc))
     4401                            if (RT_FAILURE(vrc))
    44024402                            {
    44034403                                throw setError (E_FAIL,
     
    44184418                        that->mm.vdProgress = NULL;
    44194419
    4420                         if (RT_FAILURE (vrc))
     4420                        if (RT_FAILURE(vrc))
    44214421                        {
    44224422                            throw setError (E_FAIL,
     
    44404440            if (target->m.state == MediaState_Creating)
    44414441            {
    4442                 if (SUCCEEDED (rc))
     4442                if (SUCCEEDED(rc))
    44434443                {
    44444444                    /* we set mParent & children() (note that thatLock is released
     
    44824482            if (target->m.state == MediaState_Creating)
    44834483            {
    4484                 if (SUCCEEDED (rc))
     4484                if (SUCCEEDED(rc))
    44854485                {
    44864486                    target->m.state = MediaState_Created;
     
    44964496                    /* reset UUID to prevent it from being reused next time */
    44974497                    if (generateUuid)
    4498                         unconst (target->m.id).clear();
     4498                        unconst(target->m.id).clear();
    44994499                }
    45004500            }
     
    45364536                                  VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO,
    45374537                                  that->mm.vdDiskIfaces);
    4538                     if (RT_SUCCESS (vrc))
     4538                    if (RT_SUCCESS(vrc))
    45394539                        vrc = VDClose (hdd, true /* fDelete */);
    45404540
    4541                     if (RT_FAILURE (vrc))
     4541                    if (RT_FAILURE(vrc))
    45424542                    {
    45434543                        throw setError (E_FAIL,
     
    45624562
    45634563            /* Reset UUID to prevent Create* from reusing it again */
    4564             unconst (that->m.id).clear();
     4564            unconst(that->m.id).clear();
    45654565
    45664566            break;
     
    46044604                                  VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO,
    46054605                                  that->mm.vdDiskIfaces);
    4606                     if (RT_SUCCESS (vrc))
     4606                    if (RT_SUCCESS(vrc))
    46074607                        vrc = VDClose (hdd, true /* fDelete */);
    46084608
    4609                     if (RT_FAILURE (vrc))
     4609                    if (RT_FAILURE(vrc))
    46104610                    {
    46114611                        throw setError (E_FAIL,
     
    46184618                                  VD_OPEN_FLAGS_READONLY | VD_OPEN_FLAGS_INFO,
    46194619                                  that->mm.vdDiskIfaces);
    4620                     if (RT_FAILURE (vrc))
     4620                    if (RT_FAILURE(vrc))
    46214621                    {
    46224622                        throw setError (E_FAIL,
     
    46394639                    that->mm.vdProgress = NULL;
    46404640
    4641                     if (RT_FAILURE (vrc))
     4641                    if (RT_FAILURE(vrc))
    46424642                    {
    46434643                        throw setError (E_FAIL,
     
    47094709                                      (it == last) ? VD_OPEN_FLAGS_NORMAL : VD_OPEN_FLAGS_READONLY,
    47104710                                      (*it)->mm.vdDiskIfaces);
    4711                         if (RT_FAILURE (vrc))
     4711                        if (RT_FAILURE(vrc))
    47124712                        {
    47134713                            throw setError (E_FAIL,
     
    47304730                    that->mm.vdProgress = NULL;
    47314731
    4732                     if (RT_FAILURE (vrc))
     4732                    if (RT_FAILURE(vrc))
    47334733                    {
    47344734                        if (vrc == VERR_NOT_SUPPORTED)
  • trunk/src/VBox/Main/HostDVDDriveImpl.cpp

    r20977 r21878  
    5757
    5858    /* Enclose the state transition NotReady->InInit->Ready */
    59     AutoInitSpan autoInitSpan (this);
    60     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     59    AutoInitSpan autoInitSpan(this);
     60    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6161
    62     unconst (mName) = aName;
     62    unconst(mName) = aName;
    6363    if (!aUdi)
    64         unconst (mUdi) = "";
     64        unconst(mUdi) = "";
    6565    else
    66         unconst (mUdi) = aUdi;
     66        unconst(mUdi) = aUdi;
    6767    if (!aDescription)
    68         unconst (mDescription) = "";
     68        unconst(mDescription) = "";
    6969    else
    70         unconst (mDescription) = aDescription;
     70        unconst(mDescription) = aDescription;
    7171
    7272    /* Confirm the successful initialization */
     
    8383{
    8484    /* Enclose the state transition Ready->InUninit->NotReady */
    85     AutoUninitSpan autoUninitSpan (this);
     85    AutoUninitSpan autoUninitSpan(this);
    8686    if (autoUninitSpan.uninitDone())
    8787        return;
    8888
    89     unconst (mDescription).setNull();
    90     unconst (mName).setNull();
     89    unconst(mDescription).setNull();
     90    unconst(mName).setNull();
    9191}
    9292
     
    9898    CheckComArgOutPointerValid(aName);
    9999
    100     AutoCaller autoCaller (this);
    101     CheckComRCReturnRC (autoCaller.rc());
     100    AutoCaller autoCaller(this);
     101    CheckComRCReturnRC(autoCaller.rc());
    102102
    103103    /* mName is constant during life time, no need to lock */
    104104
    105     mName.cloneTo (aName);
     105    mName.cloneTo(aName);
    106106
    107107    return S_OK;
     
    112112    CheckComArgOutPointerValid(aDescription);
    113113
    114     AutoCaller autoCaller (this);
    115     CheckComRCReturnRC (autoCaller.rc());
     114    AutoCaller autoCaller(this);
     115    CheckComRCReturnRC(autoCaller.rc());
    116116
    117117    /* mDescription is constant during life time, no need to lock */
    118118
    119     mDescription.cloneTo (aDescription);
     119    mDescription.cloneTo(aDescription);
    120120
    121121    return S_OK;
     
    126126    CheckComArgOutPointerValid(aUdi);
    127127
    128     AutoCaller autoCaller (this);
    129     CheckComRCReturnRC (autoCaller.rc());
     128    AutoCaller autoCaller(this);
     129    CheckComRCReturnRC(autoCaller.rc());
    130130
    131131    /* mUdi is constant during life time, no need to lock */
    132132
    133     mUdi.cloneTo (aUdi);
     133    mUdi.cloneTo(aUdi);
    134134
    135135    return S_OK;
  • trunk/src/VBox/Main/HostFloppyDriveImpl.cpp

    r20977 r21878  
    5757
    5858    /* Enclose the state transition NotReady->InInit->Ready */
    59     AutoInitSpan autoInitSpan (this);
    60     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     59    AutoInitSpan autoInitSpan(this);
     60    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    6161
    62     unconst (mName) = aName;
     62    unconst(mName) = aName;
    6363    if (!aUdi)
    64         unconst (mUdi) = "";
     64        unconst(mUdi) = "";
    6565    else
    66         unconst (mUdi) = aUdi;
     66        unconst(mUdi) = aUdi;
    6767    if (!aDescription)
    68         unconst (mDescription) = "";
     68        unconst(mDescription) = "";
    6969    else
    70         unconst (mDescription) = aDescription;
     70        unconst(mDescription) = aDescription;
    7171
    7272    /* Confirm the successful initialization */
     
    8484{
    8585    /* Enclose the state transition Ready->InUninit->NotReady */
    86     AutoUninitSpan autoUninitSpan (this);
     86    AutoUninitSpan autoUninitSpan(this);
    8787    if (autoUninitSpan.uninitDone())
    8888        return;
    8989
    90     unconst (mName).setNull();
     90    unconst(mName).setNull();
    9191}
    9292
     
    9898    CheckComArgOutPointerValid(aName);
    9999
    100     AutoCaller autoCaller (this);
    101     CheckComRCReturnRC (autoCaller.rc());
     100    AutoCaller autoCaller(this);
     101    CheckComRCReturnRC(autoCaller.rc());
    102102
    103103    /* mName is constant during life time, no need to lock */
    104104
    105     mName.cloneTo (aName);
     105    mName.cloneTo(aName);
    106106
    107107    return S_OK;
     
    112112    CheckComArgOutPointerValid(aDescription);
    113113
    114     AutoCaller autoCaller (this);
    115     CheckComRCReturnRC (autoCaller.rc());
     114    AutoCaller autoCaller(this);
     115    CheckComRCReturnRC(autoCaller.rc());
    116116
    117117    /* mDescription is constant during life time, no need to lock */
    118118
    119     mDescription.cloneTo (aDescription);
     119    mDescription.cloneTo(aDescription);
    120120
    121121    return S_OK;
     
    126126    CheckComArgOutPointerValid(aUdi);
    127127
    128     AutoCaller autoCaller (this);
    129     CheckComRCReturnRC (autoCaller.rc());
     128    AutoCaller autoCaller(this);
     129    CheckComRCReturnRC(autoCaller.rc());
    130130
    131131    /* mUdi is constant during life time, no need to lock */
    132132
    133     mUdi.cloneTo (aUdi);
     133    mUdi.cloneTo(aUdi);
    134134
    135135    return S_OK;
  • trunk/src/VBox/Main/HostImpl.cpp

    r21823 r21878  
    165165HRESULT Host::init(VirtualBox *aParent)
    166166{
    167     LogFlowThisFunc (("aParent=%p\n", aParent));
     167    LogFlowThisFunc(("aParent=%p\n", aParent));
    168168
    169169    /* Enclose the state transition NotReady->InInit->Ready */
    170     AutoInitSpan autoInitSpan (this);
    171     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     170    AutoInitSpan autoInitSpan(this);
     171    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    172172
    173173    mParent = aParent;
     
    270270void Host::uninit()
    271271{
    272     LogFlowThisFunc (("\n"));
     272    LogFlowThisFunc(("\n"));
    273273
    274274    /* Enclose the state transition Ready->InUninit->NotReady */
    275     AutoUninitSpan autoUninitSpan (this);
     275    AutoUninitSpan autoUninitSpan(this);
    276276    if (autoUninitSpan.uninitDone())
    277277        return;
     
    284284    /* wait for USB proxy service to terminate before we uninit all USB
    285285     * devices */
    286     LogFlowThisFunc (("Stopping USB proxy service...\n"));
     286    LogFlowThisFunc(("Stopping USB proxy service...\n"));
    287287    delete mUSBProxyService;
    288288    mUSBProxyService = NULL;
    289     LogFlowThisFunc (("Done stopping USB proxy service.\n"));
     289    LogFlowThisFunc(("Done stopping USB proxy service.\n"));
    290290#endif
    291291
     
    309309 * @param drives address of result pointer
    310310 */
    311 STDMETHODIMP Host::COMGETTER(DVDDrives) (ComSafeArrayOut (IHostDVDDrive *, aDrives))
     311STDMETHODIMP Host::COMGETTER(DVDDrives) (ComSafeArrayOut(IHostDVDDrive *, aDrives))
    312312{
    313313    CheckComArgOutSafeArrayPointerValid(aDrives);
    314314
    315     AutoCaller autoCaller (this);
    316     CheckComRCReturnRC (autoCaller.rc());
    317 
    318     AutoWriteLock alock (this);
     315    AutoCaller autoCaller(this);
     316    CheckComRCReturnRC(autoCaller.rc());
     317
     318    AutoWriteLock alock(this);
    319319
    320320    std::list< ComObjPtr<HostDVDDrive> > list;
     
    333333            {
    334334                driveName[0] = *p;
    335                 ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     335                ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    336336                hostDVDDriveObj.createObject();
    337337                hostDVDDriveObj->init (Bstr (driveName));
     
    359359                    if (validateDevice(cdromDrive, true))
    360360                    {
    361                         ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     361                        ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    362362                        hostDVDDriveObj.createObject();
    363363                        hostDVDDriveObj->init (Bstr (cdromDrive));
     
    373373                if (validateDevice("/cdrom/cdrom0", true))
    374374                {
    375                     ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     375                    ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    376376                    hostDVDDriveObj.createObject();
    377377                    hostDVDDriveObj->init (Bstr ("cdrom/cdrom0"));
     
    385385
    386386#elif defined(RT_OS_LINUX)
    387         if (RT_SUCCESS (mHostDrives.updateDVDs()))
     387        if (RT_SUCCESS(mHostDrives.updateDVDs()))
    388388            for (DriveInfoList::const_iterator it = mHostDrives.DVDBegin();
    389                 SUCCEEDED (rc) && it != mHostDrives.DVDEnd(); ++it)
     389                SUCCEEDED(rc) && it != mHostDrives.DVDEnd(); ++it)
    390390            {
    391391                ComObjPtr<HostDVDDrive> hostDVDDriveObj;
     
    393393                Bstr udi(it->mUdi);
    394394                Bstr description(it->mDescription);
    395                 if (SUCCEEDED (rc))
     395                if (SUCCEEDED(rc))
    396396                    rc = hostDVDDriveObj.createObject();
    397                 if (SUCCEEDED (rc))
     397                if (SUCCEEDED(rc))
    398398                    rc = hostDVDDriveObj->init (device, udi, description);
    399                 if (SUCCEEDED (rc))
     399                if (SUCCEEDED(rc))
    400400                    list.push_back(hostDVDDriveObj);
    401401            }
     
    425425#endif
    426426
    427         SafeIfaceArray <IHostDVDDrive> array (list);
     427        SafeIfaceArray<IHostDVDDrive> array (list);
    428428        array.detachTo(ComSafeArrayOutArg(aDrives));
    429429    }
     
    441441 * @param drives address of result pointer
    442442 */
    443 STDMETHODIMP Host::COMGETTER(FloppyDrives) (ComSafeArrayOut (IHostFloppyDrive *, aDrives))
     443STDMETHODIMP Host::COMGETTER(FloppyDrives) (ComSafeArrayOut(IHostFloppyDrive *, aDrives))
    444444{
    445445    CheckComArgOutPointerValid(aDrives);
     
    450450    AutoWriteLock alock(this);
    451451
    452     std::list<ComObjPtr <HostFloppyDrive> > list;
     452    std::list<ComObjPtr<HostFloppyDrive> > list;
    453453    HRESULT rc = S_OK;
    454454
     
    466466            {
    467467                driveName[0] = *p;
    468                 ComObjPtr <HostFloppyDrive> hostFloppyDriveObj;
     468                ComObjPtr<HostFloppyDrive> hostFloppyDriveObj;
    469469                hostFloppyDriveObj.createObject();
    470470                hostFloppyDriveObj->init (Bstr (driveName));
     
    476476        delete[] hostDrives;
    477477#elif defined(RT_OS_LINUX)
    478         if (RT_SUCCESS (mHostDrives.updateFloppies()))
     478        if (RT_SUCCESS(mHostDrives.updateFloppies()))
    479479            for (DriveInfoList::const_iterator it = mHostDrives.FloppyBegin();
    480                 SUCCEEDED (rc) && it != mHostDrives.FloppyEnd(); ++it)
     480                SUCCEEDED(rc) && it != mHostDrives.FloppyEnd(); ++it)
    481481            {
    482482                ComObjPtr<HostFloppyDrive> hostFloppyDriveObj;
     
    484484                Bstr udi(it->mUdi);
    485485                Bstr description(it->mDescription);
    486                 if (SUCCEEDED (rc))
     486                if (SUCCEEDED(rc))
    487487                    rc = hostFloppyDriveObj.createObject();
    488                 if (SUCCEEDED (rc))
     488                if (SUCCEEDED(rc))
    489489                    rc = hostFloppyDriveObj->init (device, udi, description);
    490                 if (SUCCEEDED (rc))
     490                if (SUCCEEDED(rc))
    491491                    list.push_back(hostFloppyDriveObj);
    492492            }
     
    496496
    497497        SafeIfaceArray<IHostFloppyDrive> collection (list);
    498         collection.detachTo(ComSafeArrayOutArg (aDrives));
     498        collection.detachTo(ComSafeArrayOutArg(aDrives));
    499499    }
    500500    catch(std::bad_alloc &e)
     
    509509# define VBOX_APP_NAME L"VirtualBox"
    510510
    511 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc)
     511static int vboxNetWinAddComponent(std::list <ComObjPtr<HostNetworkInterface> > * pPist, INetCfgComponent * pncc)
    512512{
    513513    LPWSTR              lpszName;
     
    530530        {
    531531            /* create a new object and add it to the list */
    532             ComObjPtr <HostNetworkInterface> iface;
     532            ComObjPtr<HostNetworkInterface> iface;
    533533            iface.createObject();
    534534            /* remove the curly bracket at the end */
    535             if (SUCCEEDED (iface->init (name, Guid (IfGuid), HostNetworkInterfaceType_Bridged)))
     535            if (SUCCEEDED(iface->init (name, Guid (IfGuid), HostNetworkInterfaceType_Bridged)))
    536536            {
    537537//                iface->setVirtualBox(mParent);
     
    556556 * @param drives address of result pointer
    557557 */
    558 STDMETHODIMP Host::COMGETTER(NetworkInterfaces) (ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces))
     558STDMETHODIMP Host::COMGETTER(NetworkInterfaces) (ComSafeArrayOut(IHostNetworkInterface *, aNetworkInterfaces))
    559559{
    560560#if defined(RT_OS_WINDOWS) ||  defined(VBOX_WITH_NETFLT) /*|| defined(RT_OS_OS2)*/
    561     if (ComSafeArrayOutIsNull (aNetworkInterfaces))
     561    if (ComSafeArrayOutIsNull(aNetworkInterfaces))
    562562        return E_POINTER;
    563563
    564     AutoCaller autoCaller (this);
    565     CheckComRCReturnRC (autoCaller.rc());
    566 
    567     AutoWriteLock alock (this);
    568 
    569     std::list <ComObjPtr <HostNetworkInterface> > list;
     564    AutoCaller autoCaller(this);
     565    CheckComRCReturnRC(autoCaller.rc());
     566
     567    AutoWriteLock alock(this);
     568
     569    std::list <ComObjPtr<HostNetworkInterface> > list;
    570570
    571571#ifdef VBOX_WITH_HOSTNETIF_API
     
    820820#endif
    821821
    822     std::list <ComObjPtr <HostNetworkInterface> >::iterator it;
     822    std::list <ComObjPtr<HostNetworkInterface> >::iterator it;
    823823    for (it = list.begin(); it != list.end(); ++it)
    824824    {
     
    827827
    828828
    829     SafeIfaceArray <IHostNetworkInterface> networkInterfaces (list);
    830     networkInterfaces.detachTo (ComSafeArrayOutArg (aNetworkInterfaces));
     829    SafeIfaceArray<IHostNetworkInterface> networkInterfaces (list);
     830    networkInterfaces.detachTo(ComSafeArrayOutArg(aNetworkInterfaces));
    831831
    832832    return S_OK;
     
    838838}
    839839
    840 STDMETHODIMP Host::COMGETTER(USBDevices)(ComSafeArrayOut (IHostUSBDevice *, aUSBDevices))
     840STDMETHODIMP Host::COMGETTER(USBDevices)(ComSafeArrayOut(IHostUSBDevice *, aUSBDevices))
    841841{
    842842#ifdef VBOX_WITH_USB
    843843    CheckComArgOutSafeArrayPointerValid(aUSBDevices);
    844844
    845     AutoCaller autoCaller (this);
    846     CheckComRCReturnRC (autoCaller.rc());
    847 
    848     AutoWriteLock alock (this);
     845    AutoCaller autoCaller(this);
     846    CheckComRCReturnRC(autoCaller.rc());
     847
     848    AutoWriteLock alock(this);
    849849
    850850    MultiResult rc = checkUSBProxyService();
    851     CheckComRCReturnRC (rc);
     851    CheckComRCReturnRC(rc);
    852852
    853853    return mUSBProxyService->getDeviceCollection (ComSafeArrayOutArg(aUSBDevices));
     
    865865}
    866866
    867 STDMETHODIMP Host::COMGETTER(USBDeviceFilters) (ComSafeArrayOut (IHostUSBDeviceFilter *, aUSBDeviceFilters))
     867STDMETHODIMP Host::COMGETTER(USBDeviceFilters) (ComSafeArrayOut(IHostUSBDeviceFilter *, aUSBDeviceFilters))
    868868{
    869869#ifdef VBOX_WITH_USB
    870870    CheckComArgOutSafeArrayPointerValid(aUSBDeviceFilters);
    871871
    872     AutoCaller autoCaller (this);
    873     CheckComRCReturnRC (autoCaller.rc());
    874 
    875     AutoWriteLock alock (this);
     872    AutoCaller autoCaller(this);
     873    CheckComRCReturnRC(autoCaller.rc());
     874
     875    AutoWriteLock alock(this);
    876876
    877877    MultiResult rc = checkUSBProxyService();
    878     CheckComRCReturnRC (rc);
    879 
    880     SafeIfaceArray <IHostUSBDeviceFilter> collection (mUSBDeviceFilters);
    881     collection.detachTo (ComSafeArrayOutArg (aUSBDeviceFilters));
     878    CheckComRCReturnRC(rc);
     879
     880    SafeIfaceArray<IHostUSBDeviceFilter> collection (mUSBDeviceFilters);
     881    collection.detachTo(ComSafeArrayOutArg(aUSBDeviceFilters));
    882882
    883883    return rc;
     
    903903{
    904904    CheckComArgOutPointerValid(aCount);
    905 //     AutoCaller autoCaller (this);
    906 //     CheckComRCReturnRC (autoCaller.rc());
    907 
    908 //     AutoReadLock alock (this);
     905//     AutoCaller autoCaller(this);
     906//     CheckComRCReturnRC(autoCaller.rc());
     907
     908//     AutoReadLock alock(this);
    909909
    910910    *aCount = RTMpGetPresentCount();
     
    921921{
    922922    CheckComArgOutPointerValid(aCount);
    923 //     AutoCaller autoCaller (this);
    924 //     CheckComRCReturnRC (autoCaller.rc());
    925 
    926 //     AutoReadLock alock (this);
     923//     AutoCaller autoCaller(this);
     924//     CheckComRCReturnRC(autoCaller.rc());
     925
     926//     AutoReadLock alock(this);
    927927
    928928    *aCount = RTMpGetOnlineCount();
     
    940940{
    941941    CheckComArgOutPointerValid(aSpeed);
    942 //     AutoCaller autoCaller (this);
    943 //     CheckComRCReturnRC (autoCaller.rc());
    944 
    945 //     AutoReadLock alock (this);
     942//     AutoCaller autoCaller(this);
     943//     CheckComRCReturnRC(autoCaller.rc());
     944
     945//     AutoReadLock alock(this);
    946946
    947947    *aSpeed = RTMpGetMaxFrequency(aCpuId);
     
    958958{
    959959    CheckComArgOutPointerValid(aDescription);
    960 //     AutoCaller autoCaller (this);
    961 //     CheckComRCReturnRC (autoCaller.rc());
    962 
    963 //     AutoReadLock alock (this);
     960//     AutoCaller autoCaller(this);
     961//     CheckComRCReturnRC(autoCaller.rc());
     962
     963//     AutoReadLock alock(this);
    964964
    965965
     
    968968    if (RT_FAILURE(vrc))
    969969        return E_FAIL; /** @todo error reporting? */
    970     Bstr (szCPUModel).cloneTo (aDescription);
     970    Bstr (szCPUModel).cloneTo(aDescription);
    971971    return S_OK;
    972972}
     
    982982{
    983983    CheckComArgOutPointerValid(aSupported);
    984     AutoCaller autoCaller (this);
    985     CheckComRCReturnRC (autoCaller.rc());
    986 
    987     AutoReadLock alock (this);
     984    AutoCaller autoCaller(this);
     985    CheckComRCReturnRC(autoCaller.rc());
     986
     987    AutoReadLock alock(this);
    988988
    989989    switch (aFeature)
     
    10161016{
    10171017    CheckComArgOutPointerValid(aSize);
    1018     AutoCaller autoCaller (this);
    1019     CheckComRCReturnRC (autoCaller.rc());
    1020 
    1021     AutoWriteLock alock (this);
     1018    AutoCaller autoCaller(this);
     1019    CheckComRCReturnRC(autoCaller.rc());
     1020
     1021    AutoWriteLock alock(this);
    10221022
    10231023    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
     
    10411041{
    10421042    CheckComArgOutPointerValid(aAvailable);
    1043     AutoCaller autoCaller (this);
    1044     CheckComRCReturnRC (autoCaller.rc());
    1045 
    1046     AutoWriteLock alock (this);
     1043    AutoCaller autoCaller(this);
     1044    CheckComRCReturnRC(autoCaller.rc());
     1045
     1046    AutoWriteLock alock(this);
    10471047
    10481048    /* @todo This is an ugly hack. There must be a function in IPRT for that. */
     
    10661066{
    10671067    CheckComArgOutPointerValid(aOs);
    1068 //     AutoCaller autoCaller (this);
    1069 //     CheckComRCReturnRC (autoCaller.rc());
    1070 
    1071 //     AutoReadLock alock (this);
     1068//     AutoCaller autoCaller(this);
     1069//     CheckComRCReturnRC(autoCaller.rc());
     1070
     1071//     AutoReadLock alock(this);
    10721072
    10731073    char szOSName[80];
     
    10751075    if (RT_FAILURE(vrc))
    10761076        return E_FAIL; /** @todo error reporting? */
    1077     Bstr (szOSName).cloneTo (aOs);
     1077    Bstr (szOSName).cloneTo(aOs);
    10781078    return S_OK;
    10791079}
     
    10881088{
    10891089    CheckComArgOutPointerValid(aVersion);
    1090 //     AutoCaller autoCaller (this);
    1091 //     CheckComRCReturnRC (autoCaller.rc());
    1092 
    1093 //     AutoReadLock alock (this);
     1090//     AutoCaller autoCaller(this);
     1091//     CheckComRCReturnRC(autoCaller.rc());
     1092
     1093//     AutoReadLock alock(this);
    10941094
    10951095    /* Get the OS release. Reserve some buffer space for the service pack. */
     
    11141114    }
    11151115
    1116     Bstr (szOSRelease).cloneTo (aVersion);
     1116    Bstr (szOSRelease).cloneTo(aVersion);
    11171117    return S_OK;
    11181118}
     
    11271127{
    11281128    CheckComArgOutPointerValid(aUTCTime);
    1129 //     AutoCaller autoCaller (this);
    1130 //     CheckComRCReturnRC (autoCaller.rc());
    1131 
    1132 //     AutoReadLock alock (this);
     1129//     AutoCaller autoCaller(this);
     1130//     CheckComRCReturnRC(autoCaller.rc());
     1131
     1132//     AutoReadLock alock(this);
    11331133
    11341134    RTTIMESPEC now;
     
    11411141{
    11421142    CheckComArgOutPointerValid(aSupported);
    1143     AutoCaller autoCaller (this);
    1144     CheckComRCReturnRC (autoCaller.rc());
    1145 
    1146     AutoReadLock alock (this);
     1143    AutoCaller autoCaller(this);
     1144    CheckComRCReturnRC(autoCaller.rc());
     1145
     1146    AutoReadLock alock(this);
    11471147
    11481148    *aSupported = f3DAccelerationSupported;
     
    11601160    CheckComArgOutPointerValid(aProgress);
    11611161
    1162     AutoCaller autoCaller (this);
    1163     CheckComRCReturnRC (autoCaller.rc());
    1164 
    1165     AutoWriteLock alock (this);
     1162    AutoCaller autoCaller(this);
     1163    CheckComRCReturnRC(autoCaller.rc());
     1164
     1165    AutoWriteLock alock(this);
    11661166
    11671167    int r = NetIfCreateHostOnlyNetworkInterface (mParent, aHostNetworkInterface, aProgress);
     
    11821182    CheckComArgOutPointerValid(aProgress);
    11831183
    1184     AutoCaller autoCaller (this);
    1185     CheckComRCReturnRC (autoCaller.rc());
    1186 
    1187     AutoWriteLock alock (this);
     1184    AutoCaller autoCaller(this);
     1185    CheckComRCReturnRC(autoCaller.rc());
     1186
     1187    AutoWriteLock alock(this);
    11881188
    11891189    /* first check whether an interface with the given name already exists */
    11901190    {
    1191         ComPtr <IHostNetworkInterface> iface;
     1191        ComPtr<IHostNetworkInterface> iface;
    11921192        if (FAILED (FindHostNetworkInterfaceById (aId, iface.asOutParam())))
    11931193            return setError (VBOX_E_OBJECT_NOT_FOUND,
     
    12111211    CheckComArgOutPointerValid(aFilter);
    12121212
    1213     AutoCaller autoCaller (this);
    1214     CheckComRCReturnRC (autoCaller.rc());
    1215 
    1216     AutoWriteLock alock (this);
    1217 
    1218     ComObjPtr <HostUSBDeviceFilter> filter;
     1213    AutoCaller autoCaller(this);
     1214    CheckComRCReturnRC(autoCaller.rc());
     1215
     1216    AutoWriteLock alock(this);
     1217
     1218    ComObjPtr<HostUSBDeviceFilter> filter;
    12191219    filter.createObject();
    12201220    HRESULT rc = filter->init (this, aName);
    12211221    ComAssertComRCRet (rc, rc);
    1222     rc = filter.queryInterfaceTo (aFilter);
     1222    rc = filter.queryInterfaceTo(aFilter);
    12231223    AssertComRCReturn (rc, rc);
    12241224    return S_OK;
     
    12391239
    12401240    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
    1241     AutoCaller autoCaller (this);
    1242     CheckComRCReturnRC (autoCaller.rc());
    1243 
    1244     AutoWriteLock alock (this);
     1241    AutoCaller autoCaller(this);
     1242    CheckComRCReturnRC(autoCaller.rc());
     1243
     1244    AutoWriteLock alock(this);
    12451245
    12461246    MultiResult rc = checkUSBProxyService();
    1247     CheckComRCReturnRC (rc);
    1248 
    1249     ComObjPtr <HostUSBDeviceFilter> filter = getDependentChild (aFilter);
     1247    CheckComRCReturnRC(rc);
     1248
     1249    ComObjPtr<HostUSBDeviceFilter> filter = getDependentChild (aFilter);
    12501250    if (!filter)
    12511251        return setError (VBOX_E_INVALID_OBJECT_STATE,
     
    12901290
    12911291    /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
    1292     AutoCaller autoCaller (this);
    1293     CheckComRCReturnRC (autoCaller.rc());
    1294 
    1295     AutoWriteLock alock (this);
     1292    AutoCaller autoCaller(this);
     1293    CheckComRCReturnRC(autoCaller.rc());
     1294
     1295    AutoWriteLock alock(this);
    12961296
    12971297    MultiResult rc = checkUSBProxyService();
    1298     CheckComRCReturnRC (rc);
     1298    CheckComRCReturnRC(rc);
    12991299
    13001300    if (!mUSBDeviceFilters.size())
     
    13071307            aPosition, mUSBDeviceFilters.size() - 1);
    13081308
    1309     ComObjPtr <HostUSBDeviceFilter> filter;
     1309    ComObjPtr<HostUSBDeviceFilter> filter;
    13101310    {
    13111311        /* iterate to the position... */
     
    13191319    }
    13201320
    1321     filter.queryInterfaceTo (aFilter);
     1321    filter.queryInterfaceTo(aFilter);
    13221322
    13231323    /* notify the proxy (only when the filter is active) */
     
    13491349    using namespace settings;
    13501350
    1351     AutoCaller autoCaller (this);
    1352     CheckComRCReturnRC (autoCaller.rc());
    1353 
    1354     AutoWriteLock alock (this);
    1355 
    1356     AssertReturn (!aGlobal.isNull(), E_FAIL);
     1351    AutoCaller autoCaller(this);
     1352    CheckComRCReturnRC(autoCaller.rc());
     1353
     1354    AutoWriteLock alock(this);
     1355
     1356    AssertReturn(!aGlobal.isNull(), E_FAIL);
    13571357
    13581358    HRESULT rc = S_OK;
     
    13851385            AssertMsgFailed (("Invalid action: '%s'\n", actionStr));
    13861386
    1387         ComObjPtr <HostUSBDeviceFilter> filterObj;
     1387        ComObjPtr<HostUSBDeviceFilter> filterObj;
    13881388        filterObj.createObject();
    13891389        rc = filterObj->init (this,
     
    14131413    using namespace settings;
    14141414
    1415     AutoCaller autoCaller (this);
    1416     CheckComRCReturnRC (autoCaller.rc());
    1417 
    1418     AutoWriteLock alock (this);
     1415    AutoCaller autoCaller(this);
     1416    CheckComRCReturnRC(autoCaller.rc());
     1417
     1418    AutoWriteLock alock(this);
    14191419
    14201420    ComAssertRet (!aGlobal.isNull(), E_FAIL);
     
    14931493                                       BOOL aActiveChanged /* = FALSE */)
    14941494{
    1495     AutoCaller autoCaller (this);
    1496     CheckComRCReturnRC (autoCaller.rc());
    1497 
    1498     AutoWriteLock alock (this);
     1495    AutoCaller autoCaller(this);
     1496    CheckComRCReturnRC(autoCaller.rc());
     1497
     1498    AutoWriteLock alock(this);
    14991499
    15001500    if (aFilter->mInList)
     
    15441544void Host::getUSBFilters(Host::USBDeviceFilterList *aGlobalFilters, VirtualBox::SessionMachineVector *aMachines)
    15451545{
    1546     AutoWriteLock alock (this);
     1546    AutoWriteLock alock(this);
    15471547
    15481548    mParent->getOpenedMachines (*aMachines);
     
    15651565 * @retval  list drives found will be attached to this list
    15661566 */
    1567 bool Host::getDVDInfoFromHal(std::list <ComObjPtr <HostDVDDrive> > &list)
     1567bool Host::getDVDInfoFromHal(std::list <ComObjPtr<HostDVDDrive> > &list)
    15681568{
    15691569    bool halSuccess = false;
     
    16431643                                            description = product;
    16441644                                        }
    1645                                         ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     1645                                        ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    16461646                                        hostDVDDriveObj.createObject();
    16471647                                        hostDVDDriveObj->init (Bstr (devNode),
     
    16581658                                            gDBusErrorFree(&dbusError);
    16591659                                        }
    1660                                         ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     1660                                        ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    16611661                                        hostDVDDriveObj.createObject();
    16621662                                        hostDVDDriveObj->init (Bstr (devNode),
     
    17371737 * @retval  list drives found will be attached to this list
    17381738 */
    1739 bool Host::getFloppyInfoFromHal(std::list <ComObjPtr <HostFloppyDrive> > &list)
     1739bool Host::getFloppyInfoFromHal(std::list <ComObjPtr<HostFloppyDrive> > &list)
    17401740{
    17411741    bool halSuccess = false;
     
    18071807                                            description = product;
    18081808                                        }
    1809                                         ComObjPtr <HostFloppyDrive> hostFloppyDrive;
     1809                                        ComObjPtr<HostFloppyDrive> hostFloppyDrive;
    18101810                                        hostFloppyDrive.createObject();
    18111811                                        hostFloppyDrive->init (Bstr (devNode),
     
    18221822                                            gDBusErrorFree(&dbusError);
    18231823                                        }
    1824                                         ComObjPtr <HostFloppyDrive> hostFloppyDrive;
     1824                                        ComObjPtr<HostFloppyDrive> hostFloppyDrive;
    18251825                                        hostFloppyDrive.createObject();
    18261826                                        hostFloppyDrive->init (Bstr (devNode),
     
    18951895 * Helper function to parse the given mount file and add found entries
    18961896 */
    1897 void Host::parseMountTable(char *mountTable, std::list <ComObjPtr <HostDVDDrive> > &list)
     1897void Host::parseMountTable(char *mountTable, std::list <ComObjPtr<HostDVDDrive> > &list)
    18981898{
    18991899#ifdef RT_OS_LINUX
     
    19451945                if (validateDevice(mnt_dev, true))
    19461946                {
    1947                     ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     1947                    ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    19481948                    hostDVDDriveObj.createObject();
    19491949                    hostDVDDriveObj->init (Bstr (mnt_dev));
     
    19771977                if (validateDevice(rawDevName, true))
    19781978                {
    1979                     ComObjPtr <HostDVDDrive> hostDVDDriveObj;
     1979                    ComObjPtr<HostDVDDrive> hostDVDDriveObj;
    19801980                    hostDVDDriveObj.createObject();
    19811981                    hostDVDDriveObj->init (Bstr (rawDevName));
     
    20732073HRESULT Host::checkUSBProxyService()
    20742074{
    2075     AutoCaller autoCaller (this);
    2076     CheckComRCReturnRC (autoCaller.rc());
    2077 
    2078     AutoWriteLock alock (this);
    2079 
    2080     AssertReturn (mUSBProxyService, E_FAIL);
     2075    AutoCaller autoCaller(this);
     2076    CheckComRCReturnRC(autoCaller.rc());
     2077
     2078    AutoWriteLock alock(this);
     2079
     2080    AssertReturn(mUSBProxyService, E_FAIL);
    20812081    if (!mUSBProxyService->isActive())
    20822082    {
     
    21322132    /* Create and register base metrics */
    21332133    IUnknown *objptr;
    2134     ComObjPtr <Host> tmp = this;
    2135     tmp.queryInterfaceTo (&objptr);
     2134    ComObjPtr<Host> tmp = this;
     2135    tmp.queryInterfaceTo(&objptr);
    21362136    pm::BaseMetric *cpuLoad = new pm::HostCpuLoadRaw (hal, objptr, cpuLoadUser, cpuLoadKernel,
    21372137                                          cpuLoadIdle);
     
    22142214    *aDrive = NULL;
    22152215
    2216     SafeIfaceArray <IHostDVDDrive> drivevec;
     2216    SafeIfaceArray<IHostDVDDrive> drivevec;
    22172217    HRESULT rc = COMGETTER(DVDDrives) (ComSafeArrayAsOutParam(drivevec));
    2218     CheckComRCReturnRC (rc);
     2218    CheckComRCReturnRC(rc);
    22192219
    22202220    for (size_t i = 0; i < drivevec.size(); ++i)
     
    22222222        Bstr name;
    22232223        rc = drivevec[i]->COMGETTER(Name) (name.asOutParam());
    2224         CheckComRCReturnRC (rc);
     2224        CheckComRCReturnRC(rc);
    22252225        if (name == aName)
    22262226        {
     
    22292229            Bstr udi, description;
    22302230            rc = drivevec[i]->COMGETTER(Udi) (udi.asOutParam());
    2231             CheckComRCReturnRC (rc);
     2231            CheckComRCReturnRC(rc);
    22322232            rc = drivevec[i]->COMGETTER(Description) (description.asOutParam());
    2233             CheckComRCReturnRC (rc);
     2233            CheckComRCReturnRC(rc);
    22342234            found->init(name, udi, description);
    22352235            return found.queryInterfaceTo(aDrive);
     
    22482248    *aDrive = NULL;
    22492249
    2250     SafeIfaceArray <IHostFloppyDrive> drivevec;
     2250    SafeIfaceArray<IHostFloppyDrive> drivevec;
    22512251    HRESULT rc = COMGETTER(FloppyDrives) (ComSafeArrayAsOutParam(drivevec));
    2252     CheckComRCReturnRC (rc);
     2252    CheckComRCReturnRC(rc);
    22532253
    22542254    for (size_t i = 0; i < drivevec.size(); ++i)
     
    22562256        Bstr name;
    22572257        rc = drivevec[i]->COMGETTER(Name) (name.asOutParam());
    2258         CheckComRCReturnRC (rc);
     2258        CheckComRCReturnRC(rc);
    22592259        if (name == aName)
    22602260        {
     
    22632263            Bstr udi, description;
    22642264            rc = drivevec[i]->COMGETTER(Udi) (udi.asOutParam());
    2265             CheckComRCReturnRC (rc);
     2265            CheckComRCReturnRC(rc);
    22662266            rc = drivevec[i]->COMGETTER(Description) (description.asOutParam());
    2267             CheckComRCReturnRC (rc);
     2267            CheckComRCReturnRC(rc);
    22682268            found->init(name, udi, description);
    22692269            return found.queryInterfaceTo(aDrive);
     
    22862286
    22872287    *networkInterface = NULL;
    2288     ComObjPtr <HostNetworkInterface> found;
    2289     std::list <ComObjPtr <HostNetworkInterface> > list;
     2288    ComObjPtr<HostNetworkInterface> found;
     2289    std::list <ComObjPtr<HostNetworkInterface> > list;
    22902290    int rc = NetIfList(list);
    22912291    if (RT_FAILURE(rc))
     
    22942294        return E_FAIL;
    22952295    }
    2296     std::list <ComObjPtr <HostNetworkInterface> >::iterator it;
     2296    std::list <ComObjPtr<HostNetworkInterface> >::iterator it;
    22972297    for (it = list.begin(); it != list.end(); ++it)
    22982298    {
     
    23092309    found->setVirtualBox(mParent);
    23102310
    2311     return found.queryInterfaceTo (networkInterface);
     2311    return found.queryInterfaceTo(networkInterface);
    23122312#endif
    23132313}
     
    23242324
    23252325    *networkInterface = NULL;
    2326     ComObjPtr <HostNetworkInterface> found;
    2327     std::list <ComObjPtr <HostNetworkInterface> > list;
     2326    ComObjPtr<HostNetworkInterface> found;
     2327    std::list <ComObjPtr<HostNetworkInterface> > list;
    23282328    int rc = NetIfList(list);
    23292329    if (RT_FAILURE(rc))
     
    23322332        return E_FAIL;
    23332333    }
    2334     std::list <ComObjPtr <HostNetworkInterface> >::iterator it;
     2334    std::list <ComObjPtr<HostNetworkInterface> >::iterator it;
    23352335    for (it = list.begin(); it != list.end(); ++it)
    23362336    {
     
    23472347    found->setVirtualBox(mParent);
    23482348
    2349     return found.queryInterfaceTo (networkInterface);
    2350 #endif
    2351 }
    2352 
    2353 STDMETHODIMP Host::FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_T type, ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces))
    2354 {
    2355     std::list <ComObjPtr <HostNetworkInterface> > allList;
     2349    return found.queryInterfaceTo(networkInterface);
     2350#endif
     2351}
     2352
     2353STDMETHODIMP Host::FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_T type, ComSafeArrayOut(IHostNetworkInterface *, aNetworkInterfaces))
     2354{
     2355    std::list <ComObjPtr<HostNetworkInterface> > allList;
    23562356    int rc = NetIfList(allList);
    23572357    if(RT_FAILURE(rc))
    23582358        return E_FAIL;
    23592359
    2360     std::list <ComObjPtr <HostNetworkInterface> > resultList;
    2361 
    2362     std::list <ComObjPtr <HostNetworkInterface> >::iterator it;
     2360    std::list <ComObjPtr<HostNetworkInterface> > resultList;
     2361
     2362    std::list <ComObjPtr<HostNetworkInterface> >::iterator it;
    23632363    for (it = allList.begin(); it != allList.end(); ++it)
    23642364    {
     
    23752375    }
    23762376
    2377     SafeIfaceArray <IHostNetworkInterface> filteredNetworkInterfaces (resultList);
    2378     filteredNetworkInterfaces.detachTo (ComSafeArrayOutArg (aNetworkInterfaces));
     2377    SafeIfaceArray<IHostNetworkInterface> filteredNetworkInterfaces (resultList);
     2378    filteredNetworkInterfaces.detachTo(ComSafeArrayOutArg(aNetworkInterfaces));
    23792379
    23802380    return S_OK;
     
    23892389    *aDevice = NULL;
    23902390
    2391     SafeIfaceArray <IHostUSBDevice> devsvec;
     2391    SafeIfaceArray<IHostUSBDevice> devsvec;
    23922392    HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
    2393     CheckComRCReturnRC (rc);
     2393    CheckComRCReturnRC(rc);
    23942394
    23952395    for (size_t i = 0; i < devsvec.size(); ++i)
     
    23972397        Bstr address;
    23982398        rc = devsvec[i]->COMGETTER(Address) (address.asOutParam());
    2399         CheckComRCReturnRC (rc);
     2399        CheckComRCReturnRC(rc);
    24002400        if (address == aAddress)
    24012401        {
    2402             return ComObjPtr<IHostUSBDevice> (devsvec[i]).queryInterfaceTo (aDevice);
     2402            return ComObjPtr<IHostUSBDevice> (devsvec[i]).queryInterfaceTo(aDevice);
    24032403        }
    24042404    }
     
    24232423    *aDevice = NULL;
    24242424
    2425     SafeIfaceArray <IHostUSBDevice> devsvec;
     2425    SafeIfaceArray<IHostUSBDevice> devsvec;
    24262426    HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
    2427     CheckComRCReturnRC (rc);
     2427    CheckComRCReturnRC(rc);
    24282428
    24292429    for (size_t i = 0; i < devsvec.size(); ++i)
     
    24312431        Bstr id;
    24322432        rc = devsvec[i]->COMGETTER(Id) (id.asOutParam());
    2433         CheckComRCReturnRC (rc);
     2433        CheckComRCReturnRC(rc);
    24342434        if (id == aId)
    24352435        {
    2436             return ComObjPtr<IHostUSBDevice> (devsvec[i]).queryInterfaceTo (aDevice);
     2436            return ComObjPtr<IHostUSBDevice> (devsvec[i]).queryInterfaceTo(aDevice);
    24372437        }
    24382438    }
  • trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp

    r19239 r21878  
    6060HRESULT HostNetworkInterface::init (Bstr aInterfaceName, Guid aGuid, HostNetworkInterfaceType_T ifType)
    6161{
    62     LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n",
     62    LogFlowThisFunc(("aInterfaceName={%ls}, aGuid={%s}\n",
    6363                      aInterfaceName.raw(), aGuid.toString().raw()));
    6464
     
    6767
    6868    /* Enclose the state transition NotReady->InInit->Ready */
    69     AutoInitSpan autoInitSpan (this);
    70     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    71 
    72     unconst (mInterfaceName) = aInterfaceName;
    73     unconst (mGuid) = aGuid;
     69    AutoInitSpan autoInitSpan(this);
     70    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     71
     72    unconst(mInterfaceName) = aInterfaceName;
     73    unconst(mGuid) = aGuid;
    7474    mIfType = ifType;
    7575
     
    117117HRESULT HostNetworkInterface::init (Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, PNETIFINFO pIf)
    118118{
    119 //    LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n",
     119//    LogFlowThisFunc(("aInterfaceName={%ls}, aGuid={%s}\n",
    120120//                      aInterfaceName.raw(), aGuid.toString().raw()));
    121121
     
    125125
    126126    /* Enclose the state transition NotReady->InInit->Ready */
    127     AutoInitSpan autoInitSpan (this);
    128     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    129 
    130     unconst (mInterfaceName) = aInterfaceName;
    131     unconst (mGuid) = pIf->Uuid;
     127    AutoInitSpan autoInitSpan(this);
     128    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     129
     130    unconst(mInterfaceName) = aInterfaceName;
     131    unconst(mGuid) = pIf->Uuid;
    132132    mIfType = ifType;
    133133
     
    166166    CheckComArgOutPointerValid(aInterfaceName);
    167167
    168     AutoCaller autoCaller (this);
    169     CheckComRCReturnRC (autoCaller.rc());
    170 
    171     mInterfaceName.cloneTo (aInterfaceName);
     168    AutoCaller autoCaller(this);
     169    CheckComRCReturnRC(autoCaller.rc());
     170
     171    mInterfaceName.cloneTo(aInterfaceName);
    172172
    173173    return S_OK;
     
    184184    CheckComArgOutPointerValid(aGuid);
    185185
    186     AutoCaller autoCaller (this);
    187     CheckComRCReturnRC (autoCaller.rc());
    188 
    189     mGuid.toUtf16().cloneTo (aGuid);
     186    AutoCaller autoCaller(this);
     187    CheckComRCReturnRC(autoCaller.rc());
     188
     189    mGuid.toUtf16().cloneTo(aGuid);
    190190
    191191    return S_OK;
     
    196196    CheckComArgOutPointerValid(aDhcpEnabled);
    197197
    198     AutoCaller autoCaller (this);
    199     CheckComRCReturnRC (autoCaller.rc());
     198    AutoCaller autoCaller(this);
     199    CheckComRCReturnRC(autoCaller.rc());
    200200
    201201    *aDhcpEnabled = m.dhcpEnabled;
     
    215215    CheckComArgOutPointerValid(aIPAddress);
    216216
    217     AutoCaller autoCaller (this);
    218     CheckComRCReturnRC (autoCaller.rc());
     217    AutoCaller autoCaller(this);
     218    CheckComRCReturnRC(autoCaller.rc());
    219219
    220220    if (m.IPAddress == 0)
     
    250250    CheckComArgOutPointerValid(aNetworkMask);
    251251
    252     AutoCaller autoCaller (this);
    253     CheckComRCReturnRC (autoCaller.rc());
     252    AutoCaller autoCaller(this);
     253    CheckComRCReturnRC(autoCaller.rc());
    254254
    255255    if (m.networkMask == 0)
     
    297297    CheckComArgOutPointerValid(aIPV6Address);
    298298
    299     AutoCaller autoCaller (this);
    300     CheckComRCReturnRC (autoCaller.rc());
    301 
    302     m.IPV6Address.cloneTo (aIPV6Address);
     299    AutoCaller autoCaller(this);
     300    CheckComRCReturnRC(autoCaller.rc());
     301
     302    m.IPV6Address.cloneTo(aIPV6Address);
    303303
    304304    return S_OK;
     
    315315    CheckComArgOutPointerValid(aIPV6NetworkMaskPrefixLength);
    316316
    317     AutoCaller autoCaller (this);
    318     CheckComRCReturnRC (autoCaller.rc());
     317    AutoCaller autoCaller(this);
     318    CheckComRCReturnRC(autoCaller.rc());
    319319
    320320    *aIPV6NetworkMaskPrefixLength = m.IPV6NetworkMaskPrefixLength;
     
    333333    CheckComArgOutPointerValid(aHardwareAddress);
    334334
    335     AutoCaller autoCaller (this);
    336     CheckComRCReturnRC (autoCaller.rc());
    337 
    338     m.hardwareAddress.cloneTo (aHardwareAddress);
     335    AutoCaller autoCaller(this);
     336    CheckComRCReturnRC(autoCaller.rc());
     337
     338    m.hardwareAddress.cloneTo(aHardwareAddress);
    339339
    340340    return S_OK;
     
    351351    CheckComArgOutPointerValid(aType);
    352352
    353     AutoCaller autoCaller (this);
    354     CheckComRCReturnRC (autoCaller.rc());
     353    AutoCaller autoCaller(this);
     354    CheckComRCReturnRC(autoCaller.rc());
    355355
    356356    *aType = m.mediumType;
     
    369369    CheckComArgOutPointerValid(aStatus);
    370370
    371     AutoCaller autoCaller (this);
    372     CheckComRCReturnRC (autoCaller.rc());
     371    AutoCaller autoCaller(this);
     372    CheckComRCReturnRC(autoCaller.rc());
    373373
    374374    *aStatus = m.status;
     
    387387    CheckComArgOutPointerValid(aType);
    388388
    389     AutoCaller autoCaller (this);
    390     CheckComRCReturnRC (autoCaller.rc());
     389    AutoCaller autoCaller(this);
     390    CheckComRCReturnRC(autoCaller.rc());
    391391
    392392    *aType = mIfType;
     
    398398STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkName) (BSTR *aNetworkName)
    399399{
    400     AutoCaller autoCaller (this);
    401     CheckComRCReturnRC (autoCaller.rc());
     400    AutoCaller autoCaller(this);
     401    CheckComRCReturnRC(autoCaller.rc());
    402402
    403403    Utf8Str utf8Name("HostInterfaceNetworking-");
    404404    utf8Name.append(Utf8Str(mInterfaceName)) ;
    405405    Bstr netName(utf8Name);
    406     netName.detachTo (aNetworkName);
     406    netName.detachTo(aNetworkName);
    407407
    408408    return S_OK;
     
    414414    return E_NOTIMPL;
    415415#else
    416     AutoCaller autoCaller (this);
    417     CheckComRCReturnRC (autoCaller.rc());
     416    AutoCaller autoCaller(this);
     417    CheckComRCReturnRC(autoCaller.rc());
    418418
    419419    if (Bstr(aIPAddress).isEmpty())
     
    481481        return E_INVALIDARG;
    482482
    483     AutoCaller autoCaller (this);
    484     CheckComRCReturnRC (autoCaller.rc());
     483    AutoCaller autoCaller(this);
     484    CheckComRCReturnRC(autoCaller.rc());
    485485
    486486    int rc = S_OK;
     
    516516    return E_NOTIMPL;
    517517#else
    518     AutoCaller autoCaller (this);
    519     CheckComRCReturnRC (autoCaller.rc());
     518    AutoCaller autoCaller(this);
     519    CheckComRCReturnRC(autoCaller.rc());
    520520
    521521    int rc = NetIfEnableDynamicIpConfig(mVBox, this);
     
    534534    return E_NOTIMPL;
    535535#else
    536     AutoCaller autoCaller (this);
    537     CheckComRCReturnRC (autoCaller.rc());
     536    AutoCaller autoCaller(this);
     537    CheckComRCReturnRC(autoCaller.rc());
    538538
    539539    int rc = NetIfDhcpRediscover(mVBox, this);
     
    550550{
    551551    HRESULT hrc;
    552     AutoCaller autoCaller (this);
    553     CheckComRCReturnRC (autoCaller.rc());
     552    AutoCaller autoCaller(this);
     553    CheckComRCReturnRC(autoCaller.rc());
    554554    mVBox = pVBox;
    555555
  • trunk/src/VBox/Main/HostPower.cpp

    r21395 r21878  
    6868            {
    6969                /* get the remote console */
    70                 ComPtr <IConsole> console;
     70                ComPtr<IConsole> console;
    7171                rc = controls [i]->GetRemoteConsole (console.asOutParam());
    7272                /* the VM could have been powered down and closed or whatever */
     
    136136            {
    137137                /* get the remote console */
    138                 ComPtr <IConsole> console;
     138                ComPtr<IConsole> console;
    139139                rc = controls [i]->GetRemoteConsole (console.asOutParam());
    140140                /* the VM could have been powered down and closed or whatever */
     
    153153                LONG iRc;
    154154                rc = progress->WaitForCompletion(-1);
    155                 if (SUCCEEDED (rc))
     155                if (SUCCEEDED(rc))
    156156                    progress->COMGETTER(ResultCode) (&iRc);
    157157                rc = iRc;
    158158
    159                 AssertMsg (SUCCEEDED (rc), ("SaveState WaitForCompletion "
     159                AssertMsg (SUCCEEDED(rc), ("SaveState WaitForCompletion "
    160160                                            "failed with %Rhrc (%#08X)\n", rc, rc));
    161161
    162                 if (SUCCEEDED (rc))
     162                if (SUCCEEDED(rc))
    163163                    ++ saved;
    164164            }
  • trunk/src/VBox/Main/KeyboardImpl.cpp

    r15715 r21878  
    8585HRESULT Keyboard::init (Console *aParent)
    8686{
    87     LogFlowThisFunc (("aParent=%p\n", aParent));
     87    LogFlowThisFunc(("aParent=%p\n", aParent));
    8888
    8989    ComAssertRet (aParent, E_INVALIDARG);
    9090
    9191    /* Enclose the state transition NotReady->InInit->Ready */
    92     AutoInitSpan autoInitSpan (this);
    93     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    94 
    95     unconst (mParent) = aParent;
     92    AutoInitSpan autoInitSpan(this);
     93    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     94
     95    unconst(mParent) = aParent;
    9696
    9797    /* Confirm a successful initialization */
     
    107107void Keyboard::uninit()
    108108{
    109     LogFlowThisFunc (("\n"));
     109    LogFlowThisFunc(("\n"));
    110110
    111111    /* Enclose the state transition Ready->InUninit->NotReady */
    112     AutoUninitSpan autoUninitSpan (this);
     112    AutoUninitSpan autoUninitSpan(this);
    113113    if (autoUninitSpan.uninitDone())
    114114        return;
     
    121121    mfVMMDevInited = true;
    122122
    123     unconst (mParent).setNull();
     123    unconst(mParent).setNull();
    124124}
    125125
     
    134134    HRESULT rc = S_OK;
    135135
    136     AutoCaller autoCaller (this);
    137     CheckComRCReturnRC (autoCaller.rc());
    138 
    139     AutoWriteLock alock (this);
     136    AutoCaller autoCaller(this);
     137    CheckComRCReturnRC(autoCaller.rc());
     138
     139    AutoWriteLock alock(this);
    140140
    141141    CHECK_CONSOLE_DRV (mpDrv);
     
    143143    int vrc = mpDrv->pUpPort->pfnPutEvent (mpDrv->pUpPort, (uint8_t)scancode);
    144144
    145     if (RT_FAILURE (vrc))
     145    if (RT_FAILURE(vrc))
    146146        rc = setError (VBOX_E_IPRT_ERROR,
    147147            tr ("Could not send scan code 0x%08X to the virtual keyboard (%Rrc)"),
     
    169169        return E_INVALIDARG;
    170170
    171     AutoCaller autoCaller (this);
    172     CheckComRCReturnRC (autoCaller.rc());
    173 
    174     AutoWriteLock alock (this);
     171    AutoCaller autoCaller(this);
     172    CheckComRCReturnRC(autoCaller.rc());
     173
     174    AutoWriteLock alock(this);
    175175
    176176    CHECK_CONSOLE_DRV (mpDrv);
    177177
    178     com::SafeArray <LONG> keys (ComSafeArrayInArg (scancodes));
     178    com::SafeArray<LONG> keys (ComSafeArrayInArg (scancodes));
    179179    int vrc = VINF_SUCCESS;
    180180
    181     for (uint32_t i = 0; (i < keys.size()) && RT_SUCCESS (vrc); i++)
     181    for (uint32_t i = 0; (i < keys.size()) && RT_SUCCESS(vrc); i++)
    182182        vrc = mpDrv->pUpPort->pfnPutEvent (mpDrv->pUpPort, (uint8_t)keys [i]);
    183183
    184     if (RT_FAILURE (vrc))
     184    if (RT_FAILURE(vrc))
    185185        return setError (VBOX_E_IPRT_ERROR,
    186186            tr ("Could not send all scan codes to the virtual keyboard (%Rrc)"),
     
    319319    void *pv;
    320320    rc = CFGMR3QueryPtr (pCfgHandle, "Object", &pv);
    321     if (RT_FAILURE (rc))
     321    if (RT_FAILURE(rc))
    322322    {
    323323        AssertMsgFailed (("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc));
  • trunk/src/VBox/Main/MachineDebuggerImpl.cpp

    r19500 r21878  
    5151HRESULT MachineDebugger::FinalConstruct()
    5252{
    53     unconst (mParent) = NULL;
     53    unconst(mParent) = NULL;
    5454    return S_OK;
    5555}
     
    7171HRESULT MachineDebugger::init (Console *aParent)
    7272{
    73     LogFlowThisFunc (("aParent=%p\n", aParent));
     73    LogFlowThisFunc(("aParent=%p\n", aParent));
    7474
    7575    ComAssertRet (aParent, E_INVALIDARG);
    7676
    7777    /* Enclose the state transition NotReady->InInit->Ready */
    78     AutoInitSpan autoInitSpan (this);
    79     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    80 
    81     unconst (mParent) = aParent;
     78    AutoInitSpan autoInitSpan(this);
     79    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     80
     81    unconst(mParent) = aParent;
    8282
    8383    mSinglestepQueued = ~0;
     
    102102void MachineDebugger::uninit()
    103103{
    104     LogFlowThisFunc (("\n"));
     104    LogFlowThisFunc(("\n"));
    105105
    106106    /* Enclose the state transition Ready->InUninit->NotReady */
    107     AutoUninitSpan autoUninitSpan (this);
     107    AutoUninitSpan autoUninitSpan(this);
    108108    if (autoUninitSpan.uninitDone())
    109109        return;
    110110
    111     unconst (mParent).setNull();
     111    unconst(mParent).setNull();
    112112    mFlushMode = false;
    113113}
     
    126126    CheckComArgOutPointerValid(aEnabled);
    127127
    128     AutoCaller autoCaller (this);
    129     CheckComRCReturnRC (autoCaller.rc());
     128    AutoCaller autoCaller(this);
     129    CheckComRCReturnRC(autoCaller.rc());
    130130
    131131    /** @todo */
     
    141141STDMETHODIMP MachineDebugger::COMSETTER(Singlestep) (BOOL aEnable)
    142142{
    143     AutoCaller autoCaller (this);
    144     CheckComRCReturnRC (autoCaller.rc());
     143    AutoCaller autoCaller(this);
     144    CheckComRCReturnRC(autoCaller.rc());
    145145
    146146    /** @todo */
     
    158158    CheckComArgOutPointerValid(aEnabled);
    159159
    160     AutoCaller autoCaller (this);
    161     CheckComRCReturnRC (autoCaller.rc());
    162 
    163     AutoReadLock alock (this);
     160    AutoCaller autoCaller(this);
     161    CheckComRCReturnRC(autoCaller.rc());
     162
     163    AutoReadLock alock(this);
    164164
    165165    Console::SafeVMPtrQuiet pVM (mParent);
     
    181181STDMETHODIMP MachineDebugger::COMSETTER(RecompileUser) (BOOL aEnable)
    182182{
    183     LogFlowThisFunc (("enable=%d\n", aEnable));
    184 
    185     AutoCaller autoCaller (this);
    186     CheckComRCReturnRC (autoCaller.rc());
    187 
    188     AutoWriteLock alock (this);
     183    LogFlowThisFunc(("enable=%d\n", aEnable));
     184
     185    AutoCaller autoCaller(this);
     186    CheckComRCReturnRC(autoCaller.rc());
     187
     188    AutoWriteLock alock(this);
    189189
    190190    if (queueSettings())
     
    196196
    197197    Console::SafeVMPtr pVM (mParent);
    198     CheckComRCReturnRC (pVM.rc());
     198    CheckComRCReturnRC(pVM.rc());
    199199
    200200    PVMREQ pReq;
     
    202202    int rcVBox = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    203203                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
    204     if (RT_SUCCESS (rcVBox))
     204    if (RT_SUCCESS(rcVBox))
    205205    {
    206206        rcVBox = pReq->iStatus;
     
    208208    }
    209209
    210     if (RT_SUCCESS (rcVBox))
     210    if (RT_SUCCESS(rcVBox))
    211211        return S_OK;
    212212
     
    226226    CheckComArgOutPointerValid(aEnabled);
    227227
    228     AutoCaller autoCaller (this);
    229     CheckComRCReturnRC (autoCaller.rc());
    230 
    231     AutoReadLock alock (this);
     228    AutoCaller autoCaller(this);
     229    CheckComRCReturnRC(autoCaller.rc());
     230
     231    AutoReadLock alock(this);
    232232
    233233    Console::SafeVMPtrQuiet pVM (mParent);
     
    249249STDMETHODIMP MachineDebugger::COMSETTER(RecompileSupervisor) (BOOL aEnable)
    250250{
    251     LogFlowThisFunc (("enable=%d\n", aEnable));
    252 
    253     AutoCaller autoCaller (this);
    254     CheckComRCReturnRC (autoCaller.rc());
    255 
    256     AutoWriteLock alock (this);
     251    LogFlowThisFunc(("enable=%d\n", aEnable));
     252
     253    AutoCaller autoCaller(this);
     254    CheckComRCReturnRC(autoCaller.rc());
     255
     256    AutoWriteLock alock(this);
    257257
    258258    if (queueSettings())
     
    264264
    265265    Console::SafeVMPtr pVM (mParent);
    266     CheckComRCReturnRC (pVM.rc());
     266    CheckComRCReturnRC(pVM.rc());
    267267
    268268    PVMREQ pReq;
     
    270270    int rcVBox = VMR3ReqCall (pVM, VMCPUID_ANY, &pReq, RT_INDEFINITE_WAIT,
    271271                              (PFNRT)EMR3RawSetMode, 2, pVM.raw(), rawModeFlag);
    272     if (RT_SUCCESS (rcVBox))
     272    if (RT_SUCCESS(rcVBox))
    273273    {
    274274        rcVBox = pReq->iStatus;
     
    276276    }
    277277
    278     if (RT_SUCCESS (rcVBox))
     278    if (RT_SUCCESS(rcVBox))
    279279        return S_OK;
    280280
     
    294294    CheckComArgOutPointerValid(aEnabled);
    295295
    296     AutoCaller autoCaller (this);
    297     CheckComRCReturnRC (autoCaller.rc());
    298 
    299     AutoReadLock alock (this);
     296    AutoCaller autoCaller(this);
     297    CheckComRCReturnRC(autoCaller.rc());
     298
     299    AutoReadLock alock(this);
    300300
    301301    Console::SafeVMPtrQuiet pVM (mParent);
     
    317317STDMETHODIMP MachineDebugger::COMSETTER(PATMEnabled) (BOOL aEnable)
    318318{
    319     LogFlowThisFunc (("enable=%d\n", aEnable));
    320 
    321     AutoCaller autoCaller (this);
    322     CheckComRCReturnRC (autoCaller.rc());
    323 
    324     AutoWriteLock alock (this);
     319    LogFlowThisFunc(("enable=%d\n", aEnable));
     320
     321    AutoCaller autoCaller(this);
     322    CheckComRCReturnRC(autoCaller.rc());
     323
     324    AutoWriteLock alock(this);
    325325
    326326    if (queueSettings())
     
    332332
    333333    Console::SafeVMPtr pVM (mParent);
    334     CheckComRCReturnRC (pVM.rc());
     334    CheckComRCReturnRC(pVM.rc());
    335335
    336336    PATMR3AllowPatching (pVM, aEnable);
     
    349349    CheckComArgOutPointerValid(aEnabled);
    350350
    351     AutoCaller autoCaller (this);
    352     CheckComRCReturnRC (autoCaller.rc());
    353 
    354     AutoReadLock alock (this);
     351    AutoCaller autoCaller(this);
     352    CheckComRCReturnRC(autoCaller.rc());
     353
     354    AutoReadLock alock(this);
    355355
    356356    Console::SafeVMPtrQuiet pVM (mParent);
     
    372372STDMETHODIMP MachineDebugger::COMSETTER(CSAMEnabled) (BOOL aEnable)
    373373{
    374     LogFlowThisFunc (("enable=%d\n", aEnable));
    375 
    376     AutoCaller autoCaller (this);
    377     CheckComRCReturnRC (autoCaller.rc());
    378 
    379     AutoWriteLock alock (this);
     374    LogFlowThisFunc(("enable=%d\n", aEnable));
     375
     376    AutoCaller autoCaller(this);
     377    CheckComRCReturnRC(autoCaller.rc());
     378
     379    AutoWriteLock alock(this);
    380380
    381381    if (queueSettings())
     
    387387
    388388    Console::SafeVMPtr pVM (mParent);
    389     CheckComRCReturnRC (pVM.rc());
     389    CheckComRCReturnRC(pVM.rc());
    390390
    391391    int vrc;
     
    395395        vrc = CSAMDisableScanning (pVM);
    396396
    397     if (RT_FAILURE (vrc))
     397    if (RT_FAILURE(vrc))
    398398    {
    399399        /** @todo handle error case */
     
    413413    CheckComArgOutPointerValid(aEnabled);
    414414
    415     AutoCaller autoCaller (this);
    416     CheckComRCReturnRC (autoCaller.rc());
     415    AutoCaller autoCaller(this);
     416    CheckComRCReturnRC(autoCaller.rc());
    417417
    418418#ifdef LOG_ENABLED
    419     AutoReadLock alock (this);
     419    AutoReadLock alock(this);
    420420
    421421    const PRTLOGGER pLogInstance = RTLogDefaultInstance();
     
    436436STDMETHODIMP MachineDebugger::COMSETTER(LogEnabled) (BOOL aEnabled)
    437437{
    438     LogFlowThisFunc (("aEnabled=%d\n", aEnabled));
    439 
    440     AutoCaller autoCaller (this);
    441     CheckComRCReturnRC (autoCaller.rc());
    442 
    443     AutoWriteLock alock (this);
     438    LogFlowThisFunc(("aEnabled=%d\n", aEnabled));
     439
     440    AutoCaller autoCaller(this);
     441    CheckComRCReturnRC(autoCaller.rc());
     442
     443    AutoWriteLock alock(this);
    444444
    445445    if (queueSettings())
     
    451451
    452452    Console::SafeVMPtr pVM (mParent);
    453     CheckComRCReturnRC (pVM.rc());
     453    CheckComRCReturnRC(pVM.rc());
    454454
    455455#ifdef LOG_ENABLED
    456456    int vrc = DBGFR3LogModifyFlags (pVM, aEnabled ? "enabled" : "disabled");
    457     if (RT_FAILURE (vrc))
     457    if (RT_FAILURE(vrc))
    458458    {
    459459        /** @todo handle error code. */
     
    474474    CheckComArgOutPointerValid(aEnabled);
    475475
    476     AutoCaller autoCaller (this);
    477     CheckComRCReturnRC (autoCaller.rc());
    478 
    479     AutoReadLock alock (this);
     476    AutoCaller autoCaller(this);
     477    CheckComRCReturnRC(autoCaller.rc());
     478
     479    AutoReadLock alock(this);
    480480
    481481    Console::SafeVMPtrQuiet pVM (mParent);
     
    499499    CheckComArgOutPointerValid(aEnabled);
    500500
    501     AutoCaller autoCaller (this);
    502     CheckComRCReturnRC (autoCaller.rc());
    503 
    504     AutoReadLock alock (this);
     501    AutoCaller autoCaller(this);
     502    CheckComRCReturnRC(autoCaller.rc());
     503
     504    AutoReadLock alock(this);
    505505
    506506    Console::SafeVMPtrQuiet pVM (mParent);
     
    524524    CheckComArgOutPointerValid(aEnabled);
    525525
    526     AutoCaller autoCaller (this);
    527     CheckComRCReturnRC (autoCaller.rc());
    528 
    529     AutoReadLock alock (this);
     526    AutoCaller autoCaller(this);
     527    CheckComRCReturnRC(autoCaller.rc());
     528
     529    AutoReadLock alock(this);
    530530
    531531    Console::SafeVMPtrQuiet pVM (mParent);
     
    549549    CheckComArgOutPointerValid(aEnabled);
    550550
    551     AutoCaller autoCaller (this);
    552     CheckComRCReturnRC (autoCaller.rc());
    553 
    554     AutoReadLock alock (this);
     551    AutoCaller autoCaller(this);
     552    CheckComRCReturnRC(autoCaller.rc());
     553
     554    AutoReadLock alock(this);
    555555
    556556    Console::SafeVMPtrQuiet pVM (mParent);
     
    577577    CheckComArgOutPointerValid(aPct);
    578578
    579     AutoCaller autoCaller (this);
    580     CheckComRCReturnRC (autoCaller.rc());
    581 
    582     AutoReadLock alock (this);
     579    AutoCaller autoCaller(this);
     580    CheckComRCReturnRC(autoCaller.rc());
     581
     582    AutoReadLock alock(this);
    583583
    584584    Console::SafeVMPtrQuiet pVM (mParent);
     
    603603        return E_INVALIDARG;
    604604
    605     AutoCaller autoCaller (this);
    606     CheckComRCReturnRC (autoCaller.rc());
    607 
    608     AutoWriteLock alock (this);
     605    AutoCaller autoCaller(this);
     606    CheckComRCReturnRC(autoCaller.rc());
     607
     608    AutoWriteLock alock(this);
    609609
    610610    if (queueSettings())
     
    616616
    617617    Console::SafeVMPtr pVM (mParent);
    618     CheckComRCReturnRC (pVM.rc());
     618    CheckComRCReturnRC(pVM.rc());
    619619
    620620    int vrc = TMR3SetWarpDrive (pVM, aPct);
    621     if (RT_FAILURE (vrc))
     621    if (RT_FAILURE(vrc))
    622622    {
    623623        /** @todo handle error code. */
     
    640640    CheckComArgOutPointerValid(aVm);
    641641
    642     AutoCaller autoCaller (this);
    643     CheckComRCReturnRC (autoCaller.rc());
    644 
    645     AutoReadLock alock (this);
     642    AutoCaller autoCaller(this);
     643    CheckComRCReturnRC(autoCaller.rc());
     644
     645    AutoReadLock alock(this);
    646646
    647647    Console::SafeVMPtr pVM (mParent);
    648     CheckComRCReturnRC (pVM.rc());
     648    CheckComRCReturnRC(pVM.rc());
    649649
    650650    *aVm = (uintptr_t)pVM.raw();
     
    715715    int vrc = STAMR3Snapshot (pVM, Utf8Str (aPattern).raw(), &pszSnapshot, NULL,
    716716                              !!aWithDescriptions);
    717     if (RT_FAILURE (vrc))
     717    if (RT_FAILURE(vrc))
    718718        return vrc == VERR_NO_MEMORY ? E_OUTOFMEMORY : E_FAIL;
    719719
     
    722722     * Until that's done, this method is kind of useless for debugger statistics GUI because
    723723     * of the amount statistics in a debug build. */
    724     Bstr (pszSnapshot).cloneTo (aStats);
     724    Bstr (pszSnapshot).cloneTo(aStats);
    725725
    726726    return S_OK;
     
    735735STDMETHODIMP MachineDebugger::InjectNMI()
    736736{
    737     LogFlowThisFunc ((""));
    738 
    739     AutoCaller autoCaller (this);
    740     CheckComRCReturnRC (autoCaller.rc());
    741 
    742     AutoWriteLock alock (this);
     737    LogFlowThisFunc((""));
     738
     739    AutoCaller autoCaller(this);
     740    CheckComRCReturnRC(autoCaller.rc());
     741
     742    AutoWriteLock alock(this);
    743743
    744744    Console::SafeVMPtr pVM (mParent);
    745     CheckComRCReturnRC (pVM.rc());
     745    CheckComRCReturnRC(pVM.rc());
    746746
    747747    HWACCMR3InjectNMI(pVM);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r21835 r21878  
    348348HRESULT Machine::FinalConstruct()
    349349{
    350     LogFlowThisFunc (("\n"));
     350    LogFlowThisFunc(("\n"));
    351351    return S_OK;
    352352}
     
    354354void Machine::FinalRelease()
    355355{
    356     LogFlowThisFunc (("\n"));
     356    LogFlowThisFunc(("\n"));
    357357    uninit();
    358358}
     
    388388{
    389389    LogFlowThisFuncEnter();
    390     LogFlowThisFunc (("aConfigFile='%ls', aMode=%d\n", aConfigFile, aMode));
    391 
    392     AssertReturn (aParent, E_INVALIDARG);
    393     AssertReturn (aConfigFile, E_INVALIDARG);
    394     AssertReturn (aMode != Init_New || (aName != NULL && *aName != '\0'),
     390    LogFlowThisFunc(("aConfigFile='%ls', aMode=%d\n", aConfigFile, aMode));
     391
     392    AssertReturn(aParent, E_INVALIDARG);
     393    AssertReturn(aConfigFile, E_INVALIDARG);
     394    AssertReturn(aMode != Init_New || (aName != NULL && *aName != '\0'),
    395395                  E_INVALIDARG);
    396     AssertReturn (aMode != Init_Registered || aId != NULL, E_FAIL);
     396    AssertReturn(aMode != Init_Registered || aId != NULL, E_FAIL);
    397397
    398398    /* Enclose the state transition NotReady->InInit->Ready */
    399     AutoInitSpan autoInitSpan (this);
    400     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     399    AutoInitSpan autoInitSpan(this);
     400    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    401401
    402402    HRESULT rc = S_OK;
    403403
    404404    /* share the parent weakly */
    405     unconst (mParent) = aParent;
     405    unconst(mParent) = aParent;
    406406
    407407    /* register with parent early, since uninit() will unconditionally
     
    419419    Utf8Str configFileFull;
    420420    int vrc = mParent->calculateFullPath (Utf8Str (aConfigFile), configFileFull);
    421     if (RT_FAILURE (vrc))
     421    if (RT_FAILURE(vrc))
    422422        return setError (VBOX_E_FILE_ERROR,
    423423            tr ("Invalid machine settings file name '%ls' (%Rrc)"),
     
    432432        /* store the supplied UUID (will be used to check for UUID consistency
    433433         * in loadSettings() */
    434         unconst (mData->mUuid) = *aId;
     434        unconst(mData->mUuid) = *aId;
    435435        rc = registeredInit();
    436436    }
     
    447447            RTFILE f = NIL_RTFILE;
    448448            int vrc = RTFileOpen (&f, configFileFull, RTFILE_O_READ);
    449             if (RT_SUCCESS (vrc) || vrc == VERR_SHARING_VIOLATION)
     449            if (RT_SUCCESS(vrc) || vrc == VERR_SHARING_VIOLATION)
    450450            {
    451451                rc = setError (VBOX_E_FILE_ERROR,
    452452                    tr ("Machine settings file '%s' already exists"),
    453453                    configFileFull.raw());
    454                 if (RT_SUCCESS (vrc))
     454                if (RT_SUCCESS(vrc))
    455455                    RTFileClose (f);
    456456            }
     
    466466            AssertFailed();
    467467
    468         if (SUCCEEDED (rc))
     468        if (SUCCEEDED(rc))
    469469            rc = initDataAndChildObjects();
    470470
    471         if (SUCCEEDED (rc))
     471        if (SUCCEEDED(rc))
    472472        {
    473473            /* set to true now to cause uninit() to call
     
    483483                /* create the machine UUID */
    484484                if (aId)
    485                     unconst (mData->mUuid) = *aId;
     485                    unconst(mData->mUuid) = *aId;
    486486                else
    487                     unconst (mData->mUuid).create();
     487                    unconst(mData->mUuid).create();
    488488
    489489                /* memorize the provided new machine's name */
     
    527527
    528528            /* commit all changes made during the initialization */
    529             if (SUCCEEDED (rc))
     529            if (SUCCEEDED(rc))
    530530                commit();
    531531        }
     
    533533
    534534    /* Confirm a successful initialization when it's the case */
    535     if (SUCCEEDED (rc))
     535    if (SUCCEEDED(rc))
    536536    {
    537537        if (mData->mAccessible)
     
    541541    }
    542542
    543     LogFlowThisFunc (("mName='%ls', mRegistered=%RTbool, mAccessible=%RTbool "
     543    LogFlowThisFunc(("mName='%ls', mRegistered=%RTbool, mAccessible=%RTbool "
    544544                      "rc=%08X\n",
    545545                      !!mUserData ? mUserData->mName.raw() : NULL,
     
    565565HRESULT Machine::registeredInit()
    566566{
    567     AssertReturn (mType == IsMachine, E_FAIL);
    568     AssertReturn (!mData->mUuid.isEmpty(), E_FAIL);
    569     AssertReturn (!mData->mAccessible, E_FAIL);
     567    AssertReturn(mType == IsMachine, E_FAIL);
     568    AssertReturn(!mData->mUuid.isEmpty(), E_FAIL);
     569    AssertReturn(!mData->mAccessible, E_FAIL);
    570570
    571571    HRESULT rc = lockConfig();
    572572
    573     if (SUCCEEDED (rc))
     573    if (SUCCEEDED(rc))
    574574        rc = initDataAndChildObjects();
    575575
    576     if (SUCCEEDED (rc))
     576    if (SUCCEEDED(rc))
    577577    {
    578578        /* Temporarily reset the registered flag in order to let setters
     
    591591    }
    592592
    593     if (SUCCEEDED (rc))
     593    if (SUCCEEDED(rc))
    594594    {
    595595        /* Set mAccessible to TRUE only if we successfully locked and loaded
     
    643643
    644644    /* Enclose the state transition Ready->InUninit->NotReady */
    645     AutoUninitSpan autoUninitSpan (this);
     645    AutoUninitSpan autoUninitSpan(this);
    646646    if (autoUninitSpan.uninitDone())
    647647        return;
     
    650650    Assert (!!mData);
    651651
    652     LogFlowThisFunc (("initFailed()=%d\n", autoUninitSpan.initFailed()));
    653     LogFlowThisFunc (("mRegistered=%d\n", mData->mRegistered));
     652    LogFlowThisFunc(("initFailed()=%d\n", autoUninitSpan.initFailed()));
     653    LogFlowThisFunc(("mRegistered=%d\n", mData->mRegistered));
    654654
    655655    /* Enter this object lock because there may be a SessionMachine instance
     
    675675         * still valid). We'll call it ourselves below.
    676676         */
    677         LogWarningThisFunc (("Session machine is not NULL (%p), "
     677        LogWarningThisFunc(("Session machine is not NULL (%p), "
    678678                             "the direct session is still open!\n",
    679679                             (SessionMachine *) mData->mSession.mMachine));
     
    681681        if (Global::IsOnlineOrTransient (mData->mMachineState))
    682682        {
    683             LogWarningThisFunc (("Setting state to Aborted!\n"));
     683            LogWarningThisFunc(("Setting state to Aborted!\n"));
    684684            /* set machine state using SessionMachine reimplementation */
    685685            static_cast <Machine *> (mData->mSession.mMachine)
     
    704704    if (isModified())
    705705    {
    706         LogWarningThisFunc (("Discarding unsaved settings changes!\n"));
     706        LogWarningThisFunc(("Discarding unsaved settings changes!\n"));
    707707        rollback (false /* aNotify */);
    708708    }
     
    724724STDMETHODIMP Machine::COMGETTER(Parent) (IVirtualBox **aParent)
    725725{
    726     CheckComArgOutPointerValid (aParent);
    727 
    728     AutoLimitedCaller autoCaller (this);
    729     CheckComRCReturnRC (autoCaller.rc());
     726    CheckComArgOutPointerValid(aParent);
     727
     728    AutoLimitedCaller autoCaller(this);
     729    CheckComRCReturnRC(autoCaller.rc());
    730730
    731731    /* mParent is constant during life time, no need to lock */
    732     mParent.queryInterfaceTo (aParent);
     732    mParent.queryInterfaceTo(aParent);
    733733
    734734    return S_OK;
     
    737737STDMETHODIMP Machine::COMGETTER(Accessible) (BOOL *aAccessible)
    738738{
    739     CheckComArgOutPointerValid (aAccessible);
    740 
    741     AutoLimitedCaller autoCaller (this);
    742     CheckComRCReturnRC (autoCaller.rc());
    743 
    744     AutoWriteLock alock (this);
     739    CheckComArgOutPointerValid(aAccessible);
     740
     741    AutoLimitedCaller autoCaller(this);
     742    CheckComRCReturnRC(autoCaller.rc());
     743
     744    AutoWriteLock alock(this);
    745745
    746746    HRESULT rc = S_OK;
     
    750750        /* try to initialize the VM once more if not accessible */
    751751
    752         AutoReinitSpan autoReinitSpan (this);
    753         AssertReturn (autoReinitSpan.isOk(), E_FAIL);
     752        AutoReinitSpan autoReinitSpan(this);
     753        AssertReturn(autoReinitSpan.isOk(), E_FAIL);
    754754
    755755        rc = registeredInit();
    756756
    757         if (SUCCEEDED (rc) && mData->mAccessible)
     757        if (SUCCEEDED(rc) && mData->mAccessible)
    758758        {
    759759            autoReinitSpan.setSucceeded();
     
    761761            /* make sure interesting parties will notice the accessibility
    762762             * state change */
    763             mParent->onMachineStateChange (mData->mUuid, mData->mMachineState);
    764             mParent->onMachineDataChange (mData->mUuid);
    765         }
    766     }
    767 
    768     if (SUCCEEDED (rc))
     763            mParent->onMachineStateChange(mData->mUuid, mData->mMachineState);
     764            mParent->onMachineDataChange(mData->mUuid);
     765        }
     766    }
     767
     768    if (SUCCEEDED(rc))
    769769        *aAccessible = mData->mAccessible;
    770770
     
    774774STDMETHODIMP Machine::COMGETTER(AccessError) (IVirtualBoxErrorInfo **aAccessError)
    775775{
    776     CheckComArgOutPointerValid (aAccessError);
    777 
    778     AutoLimitedCaller autoCaller (this);
    779     CheckComRCReturnRC (autoCaller.rc());
    780 
    781     AutoReadLock alock (this);
     776    CheckComArgOutPointerValid(aAccessError);
     777
     778    AutoLimitedCaller autoCaller(this);
     779    CheckComRCReturnRC(autoCaller.rc());
     780
     781    AutoReadLock alock(this);
    782782
    783783    if (mData->mAccessible || !mData->mAccessError.isBasicAvailable())
     
    790790    HRESULT rc = S_OK;
    791791
    792     ComObjPtr <VirtualBoxErrorInfo> errorInfo;
     792    ComObjPtr<VirtualBoxErrorInfo> errorInfo;
    793793    rc = errorInfo.createObject();
    794     if (SUCCEEDED (rc))
     794    if (SUCCEEDED(rc))
    795795    {
    796796        errorInfo->init (mData->mAccessError.getResultCode(),
     
    798798                         mData->mAccessError.getComponent(),
    799799                         mData->mAccessError.getText());
    800         rc = errorInfo.queryInterfaceTo (aAccessError);
     800        rc = errorInfo.queryInterfaceTo(aAccessError);
    801801    }
    802802
     
    806806STDMETHODIMP Machine::COMGETTER(Name) (BSTR *aName)
    807807{
    808     CheckComArgOutPointerValid (aName);
    809 
    810     AutoCaller autoCaller (this);
    811     CheckComRCReturnRC (autoCaller.rc());
    812 
    813     AutoReadLock alock (this);
    814 
    815     mUserData->mName.cloneTo (aName);
     808    CheckComArgOutPointerValid(aName);
     809
     810    AutoCaller autoCaller(this);
     811    CheckComRCReturnRC(autoCaller.rc());
     812
     813    AutoReadLock alock(this);
     814
     815    mUserData->mName.cloneTo(aName);
    816816
    817817    return S_OK;
     
    826826            tr ("Machine name cannot be empty"));
    827827
    828     AutoCaller autoCaller (this);
    829     CheckComRCReturnRC (autoCaller.rc());
    830 
    831     AutoWriteLock alock (this);
    832 
    833     HRESULT rc = checkStateDependency (MutableStateDep);
    834     CheckComRCReturnRC (rc);
     828    AutoCaller autoCaller(this);
     829    CheckComRCReturnRC(autoCaller.rc());
     830
     831    AutoWriteLock alock(this);
     832
     833    HRESULT rc = checkStateDependency(MutableStateDep);
     834    CheckComRCReturnRC(rc);
    835835
    836836    mUserData.backup();
     
    842842STDMETHODIMP Machine::COMGETTER(Description) (BSTR *aDescription)
    843843{
    844     CheckComArgOutPointerValid (aDescription);
    845 
    846     AutoCaller autoCaller (this);
    847     CheckComRCReturnRC (autoCaller.rc());
    848 
    849     AutoReadLock alock (this);
    850 
    851     mUserData->mDescription.cloneTo (aDescription);
     844    CheckComArgOutPointerValid(aDescription);
     845
     846    AutoCaller autoCaller(this);
     847    CheckComRCReturnRC(autoCaller.rc());
     848
     849    AutoReadLock alock(this);
     850
     851    mUserData->mDescription.cloneTo(aDescription);
    852852
    853853    return S_OK;
     
    856856STDMETHODIMP Machine::COMSETTER(Description) (IN_BSTR aDescription)
    857857{
    858     AutoCaller autoCaller (this);
    859     CheckComRCReturnRC (autoCaller.rc());
    860 
    861     AutoWriteLock alock (this);
    862 
    863     HRESULT rc = checkStateDependency (MutableStateDep);
    864     CheckComRCReturnRC (rc);
     858    AutoCaller autoCaller(this);
     859    CheckComRCReturnRC(autoCaller.rc());
     860
     861    AutoWriteLock alock(this);
     862
     863    HRESULT rc = checkStateDependency(MutableStateDep);
     864    CheckComRCReturnRC(rc);
    865865
    866866    mUserData.backup();
     
    872872STDMETHODIMP Machine::COMGETTER(Id) (BSTR *aId)
    873873{
    874     CheckComArgOutPointerValid (aId);
    875 
    876     AutoLimitedCaller autoCaller (this);
    877     CheckComRCReturnRC (autoCaller.rc());
    878 
    879     AutoReadLock alock (this);
    880 
    881     mData->mUuid.toUtf16().cloneTo (aId);
     874    CheckComArgOutPointerValid(aId);
     875
     876    AutoLimitedCaller autoCaller(this);
     877    CheckComRCReturnRC(autoCaller.rc());
     878
     879    AutoReadLock alock(this);
     880
     881    mData->mUuid.toUtf16().cloneTo(aId);
    882882
    883883    return S_OK;
     
    886886STDMETHODIMP Machine::COMGETTER(OSTypeId) (BSTR *aOSTypeId)
    887887{
    888     CheckComArgOutPointerValid (aOSTypeId);
    889 
    890     AutoCaller autoCaller (this);
    891     CheckComRCReturnRC (autoCaller.rc());
    892 
    893     AutoReadLock alock (this);
    894 
    895     mUserData->mOSTypeId.cloneTo (aOSTypeId);
     888    CheckComArgOutPointerValid(aOSTypeId);
     889
     890    AutoCaller autoCaller(this);
     891    CheckComRCReturnRC(autoCaller.rc());
     892
     893    AutoReadLock alock(this);
     894
     895    mUserData->mOSTypeId.cloneTo(aOSTypeId);
    896896
    897897    return S_OK;
     
    902902    CheckComArgNotNull (aOSTypeId);
    903903
    904     AutoCaller autoCaller (this);
    905     CheckComRCReturnRC (autoCaller.rc());
     904    AutoCaller autoCaller(this);
     905    CheckComRCReturnRC(autoCaller.rc());
    906906
    907907    /* look up the object by Id to check it is valid */
    908     ComPtr <IGuestOSType> guestOSType;
     908    ComPtr<IGuestOSType> guestOSType;
    909909    HRESULT rc = mParent->GetGuestOSType (aOSTypeId,
    910910                                          guestOSType.asOutParam());
    911     CheckComRCReturnRC (rc);
     911    CheckComRCReturnRC(rc);
    912912
    913913    /* when setting, always use the "etalon" value for consistency -- lookup
     
    915915    Bstr osTypeId;
    916916    rc = guestOSType->COMGETTER(Id) (osTypeId.asOutParam());
    917     CheckComRCReturnRC (rc);
    918 
    919     AutoWriteLock alock (this);
    920 
    921     rc = checkStateDependency (MutableStateDep);
    922     CheckComRCReturnRC (rc);
     917    CheckComRCReturnRC(rc);
     918
     919    AutoWriteLock alock(this);
     920
     921    rc = checkStateDependency(MutableStateDep);
     922    CheckComRCReturnRC(rc);
    923923
    924924    mUserData.backup();
     
    933933        return E_POINTER;
    934934
    935     AutoCaller autoCaller (this);
    936     CheckComRCReturnRC (autoCaller.rc());
    937 
    938     AutoReadLock alock (this);
    939 
    940     mHWData->mHWVersion.cloneTo (aHWVersion);
     935    AutoCaller autoCaller(this);
     936    CheckComRCReturnRC(autoCaller.rc());
     937
     938    AutoReadLock alock(this);
     939
     940    mHWData->mHWVersion.cloneTo(aHWVersion);
    941941
    942942    return S_OK;
     
    952952            tr ("Invalid hardware version: %ls\n"), aHWVersion);
    953953
    954     AutoCaller autoCaller (this);
    955     CheckComRCReturnRC (autoCaller.rc());
    956 
    957     AutoWriteLock alock (this);
    958 
    959     HRESULT rc = checkStateDependency (MutableStateDep);
    960     CheckComRCReturnRC (rc);
     954    AutoCaller autoCaller(this);
     955    CheckComRCReturnRC(autoCaller.rc());
     956
     957    AutoWriteLock alock(this);
     958
     959    HRESULT rc = checkStateDependency(MutableStateDep);
     960    CheckComRCReturnRC(rc);
    961961
    962962    mHWData.backup();
     
    971971        return E_POINTER;
    972972
    973     AutoCaller autoCaller (this);
    974     CheckComRCReturnRC (autoCaller.rc());
    975 
    976     AutoReadLock alock (this);
     973    AutoCaller autoCaller(this);
     974    CheckComRCReturnRC(autoCaller.rc());
     975
     976    AutoReadLock alock(this);
    977977
    978978    *memorySize = mHWData->mMemorySize;
     
    990990                memorySize, MM_RAM_MIN_IN_MB, MM_RAM_MAX_IN_MB);
    991991
    992     AutoCaller autoCaller (this);
    993     CheckComRCReturnRC (autoCaller.rc());
    994 
    995     AutoWriteLock alock (this);
    996 
    997     HRESULT rc = checkStateDependency (MutableStateDep);
    998     CheckComRCReturnRC (rc);
     992    AutoCaller autoCaller(this);
     993    CheckComRCReturnRC(autoCaller.rc());
     994
     995    AutoWriteLock alock(this);
     996
     997    HRESULT rc = checkStateDependency(MutableStateDep);
     998    CheckComRCReturnRC(rc);
    999999
    10001000    mHWData.backup();
     
    10091009        return E_POINTER;
    10101010
    1011     AutoCaller autoCaller (this);
    1012     CheckComRCReturnRC (autoCaller.rc());
    1013 
    1014     AutoReadLock alock (this);
     1011    AutoCaller autoCaller(this);
     1012    CheckComRCReturnRC(autoCaller.rc());
     1013
     1014    AutoReadLock alock(this);
    10151015
    10161016    *CPUCount = mHWData->mCPUCount;
     
    10281028                CPUCount, SchemaDefs::MinCPUCount, SchemaDefs::MaxCPUCount);
    10291029
    1030     AutoCaller autoCaller (this);
    1031     CheckComRCReturnRC (autoCaller.rc());
    1032 
    1033     AutoWriteLock alock (this);
    1034 
    1035     HRESULT rc = checkStateDependency (MutableStateDep);
    1036     CheckComRCReturnRC (rc);
     1030    AutoCaller autoCaller(this);
     1031    CheckComRCReturnRC(autoCaller.rc());
     1032
     1033    AutoWriteLock alock(this);
     1034
     1035    HRESULT rc = checkStateDependency(MutableStateDep);
     1036    CheckComRCReturnRC(rc);
    10371037
    10381038    mHWData.backup();
     
    10471047        return E_POINTER;
    10481048
    1049     AutoCaller autoCaller (this);
    1050     CheckComRCReturnRC (autoCaller.rc());
    1051 
    1052     AutoReadLock alock (this);
     1049    AutoCaller autoCaller(this);
     1050    CheckComRCReturnRC(autoCaller.rc());
     1051
     1052    AutoReadLock alock(this);
    10531053
    10541054    *memorySize = mHWData->mVRAMSize;
     
    10661066                memorySize, SchemaDefs::MinGuestVRAM, SchemaDefs::MaxGuestVRAM);
    10671067
    1068     AutoCaller autoCaller (this);
    1069     CheckComRCReturnRC (autoCaller.rc());
    1070 
    1071     AutoWriteLock alock (this);
    1072 
    1073     HRESULT rc = checkStateDependency (MutableStateDep);
    1074     CheckComRCReturnRC (rc);
     1068    AutoCaller autoCaller(this);
     1069    CheckComRCReturnRC(autoCaller.rc());
     1070
     1071    AutoWriteLock alock(this);
     1072
     1073    HRESULT rc = checkStateDependency(MutableStateDep);
     1074    CheckComRCReturnRC(rc);
    10751075
    10761076    mHWData.backup();
     
    10861086        return E_POINTER;
    10871087
    1088     AutoCaller autoCaller (this);
    1089     CheckComRCReturnRC (autoCaller.rc());
    1090 
    1091     AutoReadLock alock (this);
     1088    AutoCaller autoCaller(this);
     1089    CheckComRCReturnRC(autoCaller.rc());
     1090
     1091    AutoReadLock alock(this);
    10921092
    10931093    *memoryBalloonSize = mHWData->mMemoryBalloonSize;
     
    11051105                memoryBalloonSize, 0, VMMDEV_MAX_MEMORY_BALLOON (mHWData->mMemorySize));
    11061106
    1107     AutoCaller autoCaller (this);
    1108     CheckComRCReturnRC (autoCaller.rc());
    1109 
    1110     AutoWriteLock alock (this);
    1111 
    1112     HRESULT rc = checkStateDependency (MutableStateDep);
    1113     CheckComRCReturnRC (rc);
     1107    AutoCaller autoCaller(this);
     1108    CheckComRCReturnRC(autoCaller.rc());
     1109
     1110    AutoWriteLock alock(this);
     1111
     1112    HRESULT rc = checkStateDependency(MutableStateDep);
     1113    CheckComRCReturnRC(rc);
    11141114
    11151115    mHWData.backup();
     
    11251125        return E_POINTER;
    11261126
    1127     AutoCaller autoCaller (this);
    1128     CheckComRCReturnRC (autoCaller.rc());
    1129 
    1130     AutoReadLock alock (this);
     1127    AutoCaller autoCaller(this);
     1128    CheckComRCReturnRC(autoCaller.rc());
     1129
     1130    AutoReadLock alock(this);
    11311131
    11321132    *statisticsUpdateInterval = mHWData->mStatisticsUpdateInterval;
     
    11381138STDMETHODIMP Machine::COMSETTER(StatisticsUpdateInterval) (ULONG statisticsUpdateInterval)
    11391139{
    1140     AutoCaller autoCaller (this);
    1141     CheckComRCReturnRC (autoCaller.rc());
    1142 
    1143     AutoWriteLock alock (this);
    1144 
    1145     HRESULT rc = checkStateDependency (MutableStateDep);
    1146     CheckComRCReturnRC (rc);
     1140    AutoCaller autoCaller(this);
     1141    CheckComRCReturnRC(autoCaller.rc());
     1142
     1143    AutoWriteLock alock(this);
     1144
     1145    HRESULT rc = checkStateDependency(MutableStateDep);
     1146    CheckComRCReturnRC(rc);
    11471147
    11481148    mHWData.backup();
     
    11581158        return E_POINTER;
    11591159
    1160     AutoCaller autoCaller (this);
    1161     CheckComRCReturnRC (autoCaller.rc());
    1162 
    1163     AutoReadLock alock (this);
     1160    AutoCaller autoCaller(this);
     1161    CheckComRCReturnRC(autoCaller.rc());
     1162
     1163    AutoReadLock alock(this);
    11641164
    11651165    *enabled = mHWData->mAccelerate3DEnabled;
     
    11701170STDMETHODIMP Machine::COMSETTER(Accelerate3DEnabled)(BOOL enable)
    11711171{
    1172     AutoCaller autoCaller (this);
    1173     CheckComRCReturnRC (autoCaller.rc());
    1174 
    1175     AutoWriteLock alock (this);
    1176 
    1177     HRESULT rc = checkStateDependency (MutableStateDep);
    1178     CheckComRCReturnRC (rc);
     1172    AutoCaller autoCaller(this);
     1173    CheckComRCReturnRC(autoCaller.rc());
     1174
     1175    AutoWriteLock alock(this);
     1176
     1177    HRESULT rc = checkStateDependency(MutableStateDep);
     1178    CheckComRCReturnRC(rc);
    11791179
    11801180    /** @todo check validity! */
     
    11921192        return E_POINTER;
    11931193
    1194     AutoCaller autoCaller (this);
    1195     CheckComRCReturnRC (autoCaller.rc());
    1196 
    1197     AutoReadLock alock (this);
     1194    AutoCaller autoCaller(this);
     1195    CheckComRCReturnRC(autoCaller.rc());
     1196
     1197    AutoReadLock alock(this);
    11981198
    11991199    *monitorCount = mHWData->mMonitorCount;
     
    12101210                monitorCount, 1, SchemaDefs::MaxGuestMonitors);
    12111211
    1212     AutoCaller autoCaller (this);
    1213     CheckComRCReturnRC (autoCaller.rc());
    1214 
    1215     AutoWriteLock alock (this);
    1216 
    1217     HRESULT rc = checkStateDependency (MutableStateDep);
    1218     CheckComRCReturnRC (rc);
     1212    AutoCaller autoCaller(this);
     1213    CheckComRCReturnRC(autoCaller.rc());
     1214
     1215    AutoWriteLock alock(this);
     1216
     1217    HRESULT rc = checkStateDependency(MutableStateDep);
     1218    CheckComRCReturnRC(rc);
    12191219
    12201220    mHWData.backup();
     
    12291229        return E_POINTER;
    12301230
    1231     AutoCaller autoCaller (this);
    1232     CheckComRCReturnRC (autoCaller.rc());
     1231    AutoCaller autoCaller(this);
     1232    CheckComRCReturnRC(autoCaller.rc());
    12331233
    12341234    /* mBIOSSettings is constant during life time, no need to lock */
    1235     mBIOSSettings.queryInterfaceTo (biosSettings);
     1235    mBIOSSettings.queryInterfaceTo(biosSettings);
    12361236
    12371237    return S_OK;
     
    12431243        return E_POINTER;
    12441244
    1245     AutoCaller autoCaller (this);
    1246     CheckComRCReturnRC (autoCaller.rc());
    1247 
    1248     AutoReadLock alock (this);
     1245    AutoCaller autoCaller(this);
     1246    CheckComRCReturnRC(autoCaller.rc());
     1247
     1248    AutoReadLock alock(this);
    12491249
    12501250    *enabled = mHWData->mHWVirtExEnabled;
     
    12551255STDMETHODIMP Machine::COMSETTER(HWVirtExEnabled)(BOOL enable)
    12561256{
    1257     AutoCaller autoCaller (this);
    1258     CheckComRCReturnRC (autoCaller.rc());
    1259 
    1260     AutoWriteLock alock (this);
    1261 
    1262     HRESULT rc = checkStateDependency (MutableStateDep);
    1263     CheckComRCReturnRC (rc);
     1257    AutoCaller autoCaller(this);
     1258    CheckComRCReturnRC(autoCaller.rc());
     1259
     1260    AutoWriteLock alock(this);
     1261
     1262    HRESULT rc = checkStateDependency(MutableStateDep);
     1263    CheckComRCReturnRC(rc);
    12641264
    12651265    /** @todo check validity! */
     
    12761276        return E_POINTER;
    12771277
    1278     AutoCaller autoCaller (this);
    1279     CheckComRCReturnRC (autoCaller.rc());
    1280 
    1281     AutoReadLock alock (this);
     1278    AutoCaller autoCaller(this);
     1279    CheckComRCReturnRC(autoCaller.rc());
     1280
     1281    AutoReadLock alock(this);
    12821282
    12831283    *enabled = mHWData->mHWVirtExNestedPagingEnabled;
     
    12881288STDMETHODIMP Machine::COMSETTER(HWVirtExNestedPagingEnabled)(BOOL enable)
    12891289{
    1290     AutoCaller autoCaller (this);
    1291     CheckComRCReturnRC (autoCaller.rc());
    1292 
    1293     AutoWriteLock alock (this);
    1294 
    1295     HRESULT rc = checkStateDependency (MutableStateDep);
    1296     CheckComRCReturnRC (rc);
     1290    AutoCaller autoCaller(this);
     1291    CheckComRCReturnRC(autoCaller.rc());
     1292
     1293    AutoWriteLock alock(this);
     1294
     1295    HRESULT rc = checkStateDependency(MutableStateDep);
     1296    CheckComRCReturnRC(rc);
    12971297
    12981298    /** @todo check validity! */
     
    13091309        return E_POINTER;
    13101310
    1311     AutoCaller autoCaller (this);
    1312     CheckComRCReturnRC (autoCaller.rc());
    1313 
    1314     AutoReadLock alock (this);
     1311    AutoCaller autoCaller(this);
     1312    CheckComRCReturnRC(autoCaller.rc());
     1313
     1314    AutoReadLock alock(this);
    13151315
    13161316    *enabled = mHWData->mHWVirtExVPIDEnabled;
     
    13211321STDMETHODIMP Machine::COMSETTER(HWVirtExVPIDEnabled)(BOOL enable)
    13221322{
    1323     AutoCaller autoCaller (this);
    1324     CheckComRCReturnRC (autoCaller.rc());
    1325 
    1326     AutoWriteLock alock (this);
    1327 
    1328     HRESULT rc = checkStateDependency (MutableStateDep);
    1329     CheckComRCReturnRC (rc);
     1323    AutoCaller autoCaller(this);
     1324    CheckComRCReturnRC(autoCaller.rc());
     1325
     1326    AutoWriteLock alock(this);
     1327
     1328    HRESULT rc = checkStateDependency(MutableStateDep);
     1329    CheckComRCReturnRC(rc);
    13301330
    13311331    /** @todo check validity! */
     
    13421342        return E_POINTER;
    13431343
    1344     AutoCaller autoCaller (this);
    1345     CheckComRCReturnRC (autoCaller.rc());
    1346 
    1347     AutoReadLock alock (this);
     1344    AutoCaller autoCaller(this);
     1345    CheckComRCReturnRC(autoCaller.rc());
     1346
     1347    AutoReadLock alock(this);
    13481348
    13491349    *enabled = mHWData->mPAEEnabled;
     
    13541354STDMETHODIMP Machine::COMSETTER(PAEEnabled)(BOOL enable)
    13551355{
    1356     AutoCaller autoCaller (this);
    1357     CheckComRCReturnRC (autoCaller.rc());
    1358 
    1359     AutoWriteLock alock (this);
    1360 
    1361     HRESULT rc = checkStateDependency (MutableStateDep);
    1362     CheckComRCReturnRC (rc);
     1356    AutoCaller autoCaller(this);
     1357    CheckComRCReturnRC(autoCaller.rc());
     1358
     1359    AutoWriteLock alock(this);
     1360
     1361    HRESULT rc = checkStateDependency(MutableStateDep);
     1362    CheckComRCReturnRC(rc);
    13631363
    13641364    /** @todo check validity! */
     
    13721372STDMETHODIMP Machine::COMGETTER(SnapshotFolder) (BSTR *aSnapshotFolder)
    13731373{
    1374     CheckComArgOutPointerValid (aSnapshotFolder);
    1375 
    1376     AutoCaller autoCaller (this);
    1377     CheckComRCReturnRC (autoCaller.rc());
    1378 
    1379     AutoReadLock alock (this);
    1380 
    1381     mUserData->mSnapshotFolderFull.cloneTo (aSnapshotFolder);
     1374    CheckComArgOutPointerValid(aSnapshotFolder);
     1375
     1376    AutoCaller autoCaller(this);
     1377    CheckComRCReturnRC(autoCaller.rc());
     1378
     1379    AutoReadLock alock(this);
     1380
     1381    mUserData->mSnapshotFolderFull.cloneTo(aSnapshotFolder);
    13821382
    13831383    return S_OK;
     
    13941394     */
    13951395
    1396     AutoCaller autoCaller (this);
    1397     CheckComRCReturnRC (autoCaller.rc());
    1398 
    1399     AutoWriteLock alock (this);
    1400 
    1401     HRESULT rc = checkStateDependency (MutableStateDep);
    1402     CheckComRCReturnRC (rc);
     1396    AutoCaller autoCaller(this);
     1397    CheckComRCReturnRC(autoCaller.rc());
     1398
     1399    AutoWriteLock alock(this);
     1400
     1401    HRESULT rc = checkStateDependency(MutableStateDep);
     1402    CheckComRCReturnRC(rc);
    14031403
    14041404    if (!mData->mCurrentSnapshot.isNull())
     
    14251425
    14261426    int vrc = calculateFullPath (snapshotFolder, snapshotFolder);
    1427     if (RT_FAILURE (vrc))
     1427    if (RT_FAILURE(vrc))
    14281428        return setError (E_FAIL,
    14291429            tr ("Invalid snapshot folder '%ls' (%Rrc)"),
     
    14401440COMGETTER(HardDiskAttachments) (ComSafeArrayOut(IHardDiskAttachment *, aAttachments))
    14411441{
    1442     if (ComSafeArrayOutIsNull (aAttachments))
     1442    if (ComSafeArrayOutIsNull(aAttachments))
    14431443        return E_POINTER;
    14441444
    1445     AutoCaller autoCaller (this);
    1446     CheckComRCReturnRC (autoCaller.rc());
    1447 
    1448     AutoReadLock alock (this);
     1445    AutoCaller autoCaller(this);
     1446    CheckComRCReturnRC(autoCaller.rc());
     1447
     1448    AutoReadLock alock(this);
    14491449
    14501450    SafeIfaceArray<IHardDiskAttachment> attachments (mHDData->mAttachments);
    1451     attachments.detachTo (ComSafeArrayOutArg (aAttachments));
     1451    attachments.detachTo(ComSafeArrayOutArg(aAttachments));
    14521452
    14531453    return S_OK;
     
    14601460        return E_POINTER;
    14611461
    1462     AutoCaller autoCaller (this);
    1463     CheckComRCReturnRC (autoCaller.rc());
    1464 
    1465     AutoReadLock alock (this);
     1462    AutoCaller autoCaller(this);
     1463    CheckComRCReturnRC(autoCaller.rc());
     1464
     1465    AutoReadLock alock(this);
    14661466
    14671467    Assert (!!mVRDPServer);
    1468     mVRDPServer.queryInterfaceTo (vrdpServer);
     1468    mVRDPServer.queryInterfaceTo(vrdpServer);
    14691469
    14701470    return S_OK;
     
    14801480        return E_POINTER;
    14811481
    1482     AutoCaller autoCaller (this);
    1483     CheckComRCReturnRC (autoCaller.rc());
    1484 
    1485     AutoReadLock alock (this);
     1482    AutoCaller autoCaller(this);
     1483    CheckComRCReturnRC(autoCaller.rc());
     1484
     1485    AutoReadLock alock(this);
    14861486
    14871487    Assert (!!mDVDDrive);
    1488     mDVDDrive.queryInterfaceTo (dvdDrive);
     1488    mDVDDrive.queryInterfaceTo(dvdDrive);
    14891489    return S_OK;
    14901490}
     
    14951495        return E_POINTER;
    14961496
    1497     AutoCaller autoCaller (this);
    1498     CheckComRCReturnRC (autoCaller.rc());
    1499 
    1500     AutoReadLock alock (this);
     1497    AutoCaller autoCaller(this);
     1498    CheckComRCReturnRC(autoCaller.rc());
     1499
     1500    AutoReadLock alock(this);
    15011501
    15021502    Assert (!!mFloppyDrive);
    1503     mFloppyDrive.queryInterfaceTo (floppyDrive);
     1503    mFloppyDrive.queryInterfaceTo(floppyDrive);
    15041504    return S_OK;
    15051505}
     
    15101510        return E_POINTER;
    15111511
    1512     AutoCaller autoCaller (this);
    1513     CheckComRCReturnRC (autoCaller.rc());
    1514 
    1515     AutoReadLock alock (this);
    1516 
    1517     mAudioAdapter.queryInterfaceTo (audioAdapter);
     1512    AutoCaller autoCaller(this);
     1513    CheckComRCReturnRC(autoCaller.rc());
     1514
     1515    AutoReadLock alock(this);
     1516
     1517    mAudioAdapter.queryInterfaceTo(audioAdapter);
    15181518    return S_OK;
    15191519}
     
    15221522{
    15231523#ifdef VBOX_WITH_USB
    1524     CheckComArgOutPointerValid (aUSBController);
    1525 
    1526     AutoCaller autoCaller (this);
    1527     CheckComRCReturnRC (autoCaller.rc());
     1524    CheckComArgOutPointerValid(aUSBController);
     1525
     1526    AutoCaller autoCaller(this);
     1527    CheckComRCReturnRC(autoCaller.rc());
    15281528
    15291529    MultiResult rc = mParent->host()->checkUSBProxyService();
    1530     CheckComRCReturnRC (rc);
    1531 
    1532     AutoReadLock alock (this);
    1533 
    1534     return rc = mUSBController.queryInterfaceTo (aUSBController);
     1530    CheckComRCReturnRC(rc);
     1531
     1532    AutoReadLock alock(this);
     1533
     1534    return rc = mUSBController.queryInterfaceTo(aUSBController);
    15351535#else
    15361536    /* Note: The GUI depends on this method returning E_NOTIMPL with no
     
    15441544STDMETHODIMP Machine::COMGETTER(SettingsFilePath) (BSTR *aFilePath)
    15451545{
    1546     CheckComArgOutPointerValid (aFilePath);
    1547 
    1548     AutoLimitedCaller autoCaller (this);
    1549     CheckComRCReturnRC (autoCaller.rc());
    1550 
    1551     AutoReadLock alock (this);
    1552 
    1553     mData->mConfigFileFull.cloneTo (aFilePath);
     1546    CheckComArgOutPointerValid(aFilePath);
     1547
     1548    AutoLimitedCaller autoCaller(this);
     1549    CheckComRCReturnRC(autoCaller.rc());
     1550
     1551    AutoReadLock alock(this);
     1552
     1553    mData->mConfigFileFull.cloneTo(aFilePath);
    15541554    return S_OK;
    15551555}
     
    15581558COMGETTER(SettingsFileVersion) (BSTR *aSettingsFileVersion)
    15591559{
    1560     CheckComArgOutPointerValid (aSettingsFileVersion);
    1561 
    1562     AutoCaller autoCaller (this);
    1563     CheckComRCReturnRC (autoCaller.rc());
    1564 
    1565     AutoReadLock alock (this);
    1566 
    1567     mData->mSettingsFileVersion.cloneTo (aSettingsFileVersion);
     1560    CheckComArgOutPointerValid(aSettingsFileVersion);
     1561
     1562    AutoCaller autoCaller(this);
     1563    CheckComRCReturnRC(autoCaller.rc());
     1564
     1565    AutoReadLock alock(this);
     1566
     1567    mData->mSettingsFileVersion.cloneTo(aSettingsFileVersion);
    15681568    return S_OK;
    15691569}
     
    15711571STDMETHODIMP Machine::COMGETTER(SettingsModified) (BOOL *aModified)
    15721572{
    1573     CheckComArgOutPointerValid (aModified);
    1574 
    1575     AutoCaller autoCaller (this);
    1576     CheckComRCReturnRC (autoCaller.rc());
    1577 
    1578     AutoWriteLock alock (this);
    1579 
    1580     HRESULT rc = checkStateDependency (MutableStateDep);
    1581     CheckComRCReturnRC (rc);
     1573    CheckComArgOutPointerValid(aModified);
     1574
     1575    AutoCaller autoCaller(this);
     1576    CheckComRCReturnRC(autoCaller.rc());
     1577
     1578    AutoWriteLock alock(this);
     1579
     1580    HRESULT rc = checkStateDependency(MutableStateDep);
     1581    CheckComRCReturnRC(rc);
    15821582
    15831583    if (!isConfigLocked())
     
    15991599STDMETHODIMP Machine::COMGETTER(SessionState) (SessionState_T *aSessionState)
    16001600{
    1601     CheckComArgOutPointerValid (aSessionState);
    1602 
    1603     AutoCaller autoCaller (this);
    1604     CheckComRCReturnRC (autoCaller.rc());
    1605 
    1606     AutoReadLock alock (this);
     1601    CheckComArgOutPointerValid(aSessionState);
     1602
     1603    AutoCaller autoCaller(this);
     1604    CheckComRCReturnRC(autoCaller.rc());
     1605
     1606    AutoReadLock alock(this);
    16071607
    16081608    *aSessionState = mData->mSession.mState;
     
    16131613STDMETHODIMP Machine::COMGETTER(SessionType) (BSTR *aSessionType)
    16141614{
    1615     CheckComArgOutPointerValid (aSessionType);
    1616 
    1617     AutoCaller autoCaller (this);
    1618     CheckComRCReturnRC (autoCaller.rc());
    1619 
    1620     AutoReadLock alock (this);
     1615    CheckComArgOutPointerValid(aSessionType);
     1616
     1617    AutoCaller autoCaller(this);
     1618    CheckComRCReturnRC(autoCaller.rc());
     1619
     1620    AutoReadLock alock(this);
    16211621
    16221622    if (mData->mSession.mType.isNull())
    16231623        Bstr("").cloneTo(aSessionType);
    16241624    else
    1625         mData->mSession.mType.cloneTo (aSessionType);
     1625        mData->mSession.mType.cloneTo(aSessionType);
    16261626
    16271627    return S_OK;
     
    16301630STDMETHODIMP Machine::COMGETTER(SessionPid) (ULONG *aSessionPid)
    16311631{
    1632     CheckComArgOutPointerValid (aSessionPid);
    1633 
    1634     AutoCaller autoCaller (this);
    1635     CheckComRCReturnRC (autoCaller.rc());
    1636 
    1637     AutoReadLock alock (this);
     1632    CheckComArgOutPointerValid(aSessionPid);
     1633
     1634    AutoCaller autoCaller(this);
     1635    CheckComRCReturnRC(autoCaller.rc());
     1636
     1637    AutoReadLock alock(this);
    16381638
    16391639    *aSessionPid = mData->mSession.mPid;
     
    16471647        return E_POINTER;
    16481648
    1649     AutoCaller autoCaller (this);
    1650     CheckComRCReturnRC (autoCaller.rc());
    1651 
    1652     AutoReadLock alock (this);
     1649    AutoCaller autoCaller(this);
     1650    CheckComRCReturnRC(autoCaller.rc());
     1651
     1652    AutoReadLock alock(this);
    16531653
    16541654    *machineState = mData->mMachineState;
     
    16591659STDMETHODIMP Machine::COMGETTER(LastStateChange) (LONG64 *aLastStateChange)
    16601660{
    1661     CheckComArgOutPointerValid (aLastStateChange);
    1662 
    1663     AutoCaller autoCaller (this);
    1664     CheckComRCReturnRC (autoCaller.rc());
    1665 
    1666     AutoReadLock alock (this);
     1661    CheckComArgOutPointerValid(aLastStateChange);
     1662
     1663    AutoCaller autoCaller(this);
     1664    CheckComRCReturnRC(autoCaller.rc());
     1665
     1666    AutoReadLock alock(this);
    16671667
    16681668    *aLastStateChange = RTTimeSpecGetMilli (&mData->mLastStateChange);
     
    16731673STDMETHODIMP Machine::COMGETTER(StateFilePath) (BSTR *aStateFilePath)
    16741674{
    1675     CheckComArgOutPointerValid (aStateFilePath);
    1676 
    1677     AutoCaller autoCaller (this);
    1678     CheckComRCReturnRC (autoCaller.rc());
    1679 
    1680     AutoReadLock alock (this);
     1675    CheckComArgOutPointerValid(aStateFilePath);
     1676
     1677    AutoCaller autoCaller(this);
     1678    CheckComRCReturnRC(autoCaller.rc());
     1679
     1680    AutoReadLock alock(this);
    16811681
    16821682    if (mSSData->mStateFilePath.isEmpty())
    16831683        Bstr("").cloneTo(aStateFilePath);
    16841684    else
    1685         mSSData->mStateFilePath.cloneTo (aStateFilePath);
     1685        mSSData->mStateFilePath.cloneTo(aStateFilePath);
    16861686
    16871687    return S_OK;
     
    16901690STDMETHODIMP Machine::COMGETTER(LogFolder) (BSTR *aLogFolder)
    16911691{
    1692     CheckComArgOutPointerValid (aLogFolder);
    1693 
    1694     AutoCaller autoCaller (this);
    1695     AssertComRCReturnRC (autoCaller.rc());
    1696 
    1697     AutoReadLock alock (this);
     1692    CheckComArgOutPointerValid(aLogFolder);
     1693
     1694    AutoCaller autoCaller(this);
     1695    AssertComRCReturnRC(autoCaller.rc());
     1696
     1697    AutoReadLock alock(this);
    16981698
    16991699    Utf8Str logFolder;
    17001700    getLogFolder (logFolder);
    17011701
    1702     Bstr (logFolder).cloneTo (aLogFolder);
     1702    Bstr (logFolder).cloneTo(aLogFolder);
    17031703
    17041704    return S_OK;
     
    17071707STDMETHODIMP Machine::COMGETTER(CurrentSnapshot) (ISnapshot **aCurrentSnapshot)
    17081708{
    1709     CheckComArgOutPointerValid (aCurrentSnapshot);
    1710 
    1711     AutoCaller autoCaller (this);
    1712     CheckComRCReturnRC (autoCaller.rc());
    1713 
    1714     AutoReadLock alock (this);
    1715 
    1716     mData->mCurrentSnapshot.queryInterfaceTo (aCurrentSnapshot);
     1709    CheckComArgOutPointerValid(aCurrentSnapshot);
     1710
     1711    AutoCaller autoCaller(this);
     1712    CheckComRCReturnRC(autoCaller.rc());
     1713
     1714    AutoReadLock alock(this);
     1715
     1716    mData->mCurrentSnapshot.queryInterfaceTo(aCurrentSnapshot);
    17171717
    17181718    return S_OK;
     
    17211721STDMETHODIMP Machine::COMGETTER(SnapshotCount)(ULONG *aSnapshotCount)
    17221722{
    1723     CheckComArgOutPointerValid (aSnapshotCount);
    1724 
    1725     AutoCaller autoCaller (this);
    1726     CheckComRCReturnRC (autoCaller.rc());
     1723    CheckComArgOutPointerValid(aSnapshotCount);
     1724
     1725    AutoCaller autoCaller(this);
     1726    CheckComRCReturnRC(autoCaller.rc());
    17271727
    17281728    AutoReadLock alock(this);
     
    17371737STDMETHODIMP Machine::COMGETTER(CurrentStateModified) (BOOL *aCurrentStateModified)
    17381738{
    1739     CheckComArgOutPointerValid (aCurrentStateModified);
    1740 
    1741     AutoCaller autoCaller (this);
    1742     CheckComRCReturnRC (autoCaller.rc());
    1743 
    1744     AutoReadLock alock (this);
     1739    CheckComArgOutPointerValid(aCurrentStateModified);
     1740
     1741    AutoCaller autoCaller(this);
     1742    CheckComRCReturnRC(autoCaller.rc());
     1743
     1744    AutoReadLock alock(this);
    17451745
    17461746    /* Note: for machines with no snapshots, we always return FALSE
     
    17551755
    17561756STDMETHODIMP
    1757 Machine::COMGETTER(SharedFolders) (ComSafeArrayOut (ISharedFolder *, aSharedFolders))
    1758 {
    1759     CheckComArgOutSafeArrayPointerValid (aSharedFolders);
    1760 
    1761     AutoCaller autoCaller (this);
    1762     CheckComRCReturnRC (autoCaller.rc());
    1763 
    1764     AutoReadLock alock (this);
    1765 
    1766     SafeIfaceArray <ISharedFolder> folders (mHWData->mSharedFolders);
    1767     folders.detachTo (ComSafeArrayOutArg(aSharedFolders));
     1757Machine::COMGETTER(SharedFolders) (ComSafeArrayOut(ISharedFolder *, aSharedFolders))
     1758{
     1759    CheckComArgOutSafeArrayPointerValid(aSharedFolders);
     1760
     1761    AutoCaller autoCaller(this);
     1762    CheckComRCReturnRC(autoCaller.rc());
     1763
     1764    AutoReadLock alock(this);
     1765
     1766    SafeIfaceArray<ISharedFolder> folders (mHWData->mSharedFolders);
     1767    folders.detachTo(ComSafeArrayOutArg(aSharedFolders));
    17681768
    17691769    return S_OK;
     
    17731773Machine::COMGETTER(ClipboardMode) (ClipboardMode_T *aClipboardMode)
    17741774{
    1775     CheckComArgOutPointerValid (aClipboardMode);
    1776 
    1777     AutoCaller autoCaller (this);
    1778     CheckComRCReturnRC (autoCaller.rc());
    1779 
    1780     AutoReadLock alock (this);
     1775    CheckComArgOutPointerValid(aClipboardMode);
     1776
     1777    AutoCaller autoCaller(this);
     1778    CheckComRCReturnRC(autoCaller.rc());
     1779
     1780    AutoReadLock alock(this);
    17811781
    17821782    *aClipboardMode = mHWData->mClipboardMode;
     
    17881788Machine::COMSETTER(ClipboardMode) (ClipboardMode_T aClipboardMode)
    17891789{
    1790     AutoCaller autoCaller (this);
    1791     CheckComRCReturnRC (autoCaller.rc());
    1792 
    1793     AutoWriteLock alock (this);
    1794 
    1795     HRESULT rc = checkStateDependency (MutableStateDep);
    1796     CheckComRCReturnRC (rc);
     1790    AutoCaller autoCaller(this);
     1791    CheckComRCReturnRC(autoCaller.rc());
     1792
     1793    AutoWriteLock alock(this);
     1794
     1795    HRESULT rc = checkStateDependency(MutableStateDep);
     1796    CheckComRCReturnRC(rc);
    17971797
    17981798    mHWData.backup();
     
    18051805Machine::COMGETTER(GuestPropertyNotificationPatterns) (BSTR *aPatterns)
    18061806{
    1807     CheckComArgOutPointerValid (aPatterns);
    1808 
    1809     AutoCaller autoCaller (this);
    1810     CheckComRCReturnRC (autoCaller.rc());
    1811 
    1812     AutoReadLock alock (this);
    1813 
    1814     mHWData->mGuestPropertyNotificationPatterns.cloneTo (aPatterns);
     1807    CheckComArgOutPointerValid(aPatterns);
     1808
     1809    AutoCaller autoCaller(this);
     1810    CheckComRCReturnRC(autoCaller.rc());
     1811
     1812    AutoReadLock alock(this);
     1813
     1814    mHWData->mGuestPropertyNotificationPatterns.cloneTo(aPatterns);
    18151815
    18161816    return RT_LIKELY (aPatterns != NULL) ? S_OK : E_OUTOFMEMORY;
     
    18211821{
    18221822    AssertLogRelReturn (VALID_PTR (aPatterns), E_POINTER);
    1823     AutoCaller autoCaller (this);
    1824     CheckComRCReturnRC (autoCaller.rc());
    1825 
    1826     AutoWriteLock alock (this);
    1827 
    1828     HRESULT rc = checkStateDependency (MutableStateDep);
    1829     CheckComRCReturnRC (rc);
     1823    AutoCaller autoCaller(this);
     1824    CheckComRCReturnRC(autoCaller.rc());
     1825
     1826    AutoWriteLock alock(this);
     1827
     1828    HRESULT rc = checkStateDependency(MutableStateDep);
     1829    CheckComRCReturnRC(rc);
    18301830
    18311831    mHWData.backup();
     
    18391839Machine::COMGETTER(StorageControllers) (ComSafeArrayOut(IStorageController *, aStorageControllers))
    18401840{
    1841     CheckComArgOutSafeArrayPointerValid (aStorageControllers);
    1842 
    1843     AutoCaller autoCaller (this);
    1844     CheckComRCReturnRC (autoCaller.rc());
    1845 
    1846     AutoReadLock alock (this);
    1847 
    1848     SafeIfaceArray <IStorageController> ctrls (*mStorageControllers.data());
    1849     ctrls.detachTo (ComSafeArrayOutArg(aStorageControllers));
     1841    CheckComArgOutSafeArrayPointerValid(aStorageControllers);
     1842
     1843    AutoCaller autoCaller(this);
     1844    CheckComRCReturnRC(autoCaller.rc());
     1845
     1846    AutoReadLock alock(this);
     1847
     1848    SafeIfaceArray<IStorageController> ctrls (*mStorageControllers.data());
     1849    ctrls.detachTo(ComSafeArrayOutArg(aStorageControllers));
    18501850
    18511851    return S_OK;
     
    18661866            tr ("Booting from USB device is currently not supported"));
    18671867
    1868     AutoCaller autoCaller (this);
    1869     CheckComRCReturnRC (autoCaller.rc());
    1870 
    1871     AutoWriteLock alock (this);
    1872 
    1873     HRESULT rc = checkStateDependency (MutableStateDep);
    1874     CheckComRCReturnRC (rc);
     1868    AutoCaller autoCaller(this);
     1869    CheckComRCReturnRC(autoCaller.rc());
     1870
     1871    AutoWriteLock alock(this);
     1872
     1873    HRESULT rc = checkStateDependency(MutableStateDep);
     1874    CheckComRCReturnRC(rc);
    18751875
    18761876    mHWData.backup();
     
    18871887                aPosition, SchemaDefs::MaxBootPosition);
    18881888
    1889     AutoCaller autoCaller (this);
    1890     CheckComRCReturnRC (autoCaller.rc());
    1891 
    1892     AutoReadLock alock (this);
     1889    AutoCaller autoCaller(this);
     1890    CheckComRCReturnRC(autoCaller.rc());
     1891
     1892    AutoReadLock alock(this);
    18931893
    18941894    *aDevice = mHWData->mBootOrder [aPosition - 1];
     
    19041904                     aControllerName, aControllerPort, aDevice));
    19051905
    1906     AutoCaller autoCaller (this);
    1907     CheckComRCReturnRC (autoCaller.rc());
     1906    AutoCaller autoCaller(this);
     1907    CheckComRCReturnRC(autoCaller.rc());
    19081908
    19091909    /* VirtualBox::findHardDisk() need read lock; also we want to make sure the
    19101910     * hard disk object we pick up doesn't get unregistered before we finish. */
    19111911    AutoReadLock vboxLock (mParent);
    1912     AutoWriteLock alock (this);
    1913 
    1914     HRESULT rc = checkStateDependency (MutableStateDep);
    1915     CheckComRCReturnRC (rc);
     1912    AutoWriteLock alock(this);
     1913
     1914    HRESULT rc = checkStateDependency(MutableStateDep);
     1915    CheckComRCReturnRC(rc);
    19161916
    19171917    /// @todo NEWMEDIA implicit machine registration
     
    19201920            tr ("Cannot attach hard disks to an unregistered machine"));
    19211921
    1922     AssertReturn (mData->mMachineState != MachineState_Saved, E_FAIL);
     1922    AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL);
    19231923
    19241924    if (Global::IsOnlineOrTransient (mData->mMachineState))
     
    19691969    ComObjPtr<HardDisk> hd;
    19701970    rc = mParent->findHardDisk(&id, NULL, true /* aSetError */, &hd);
    1971     CheckComRCReturnRC (rc);
     1971    CheckComRCReturnRC(rc);
    19721972
    19731973    AutoCaller hdCaller (hd);
    1974     CheckComRCReturnRC (hdCaller.rc());
     1974    CheckComRCReturnRC(hdCaller.rc());
    19751975
    19761976    AutoWriteLock hdLock (hd);
     
    20042004            if (it != oldAtts.end())
    20052005            {
    2006                 AssertReturn (!indirect, E_FAIL);
     2006                AssertReturn(!indirect, E_FAIL);
    20072007
    20082008                /* see if it's the same bus/channel/device */
     
    20892089                    hd = (*foundIt)->hardDisk();
    20902090                    hdCaller.attach (hd);
    2091                     CheckComRCReturnRC (hdCaller.rc());
     2091                    CheckComRCReturnRC(hdCaller.rc());
    20922092                    hdLock.attach (hd);
    20932093                    /* not implicit, doesn't require association with this VM */
     
    21562156                hd = base;
    21572157                hdCaller.attach (hd);
    2158                 CheckComRCReturnRC (hdCaller.rc());
     2158                CheckComRCReturnRC(hdCaller.rc());
    21592159                hdLock.attach (hd);
    21602160            }
     
    21672167                        BstrFmt ("%ls"RTPATH_SLASH_STR,
    21682168                                 mUserData->mSnapshotFolderFull.raw()));
    2169         CheckComRCReturnRC (rc);
     2169        CheckComRCReturnRC(rc);
    21702170
    21712171        /* make sure the hard disk is not modified before createDiffStorage() */
    21722172        rc = hd->LockRead (NULL);
    2173         CheckComRCReturnRC (rc);
     2173        CheckComRCReturnRC(rc);
    21742174
    21752175        /* will leave the lock before the potentially lengthy operation, so
     
    21912191        hd->UnlockRead (NULL);
    21922192
    2193         CheckComRCReturnRC (rc);
     2193        CheckComRCReturnRC(rc);
    21942194
    21952195        /* use the created diff for the actual attachment */
    21962196        hd = diff;
    21972197        hdCaller.attach (hd);
    2198         CheckComRCReturnRC (hdCaller.rc());
     2198        CheckComRCReturnRC(hdCaller.rc());
    21992199        hdLock.attach (hd);
    22002200    }
     
    22042204    attachment.createObject();
    22052205    rc = attachment->init (hd, aControllerName, aControllerPort, aDevice, indirect);
    2206     CheckComRCReturnRC (rc);
     2206    CheckComRCReturnRC(rc);
    22072207
    22082208    if (associate)
     
    22122212        /* here we can fail because of Deleting, or being in process of
    22132213         * creating a Diff */
    2214         CheckComRCReturnRC (rc);
     2214        CheckComRCReturnRC(rc);
    22152215    }
    22162216
     
    22292229
    22302230    CheckComArgNotNull (aControllerName);
    2231     CheckComArgOutPointerValid (aHardDisk);
    2232 
    2233     AutoCaller autoCaller (this);
    2234     CheckComRCReturnRC (autoCaller.rc());
    2235 
    2236     AutoReadLock alock (this);
     2231    CheckComArgOutPointerValid(aHardDisk);
     2232
     2233    AutoCaller autoCaller(this);
     2234    CheckComRCReturnRC(autoCaller.rc());
     2235
     2236    AutoReadLock alock(this);
    22372237
    22382238    *aHardDisk = NULL;
     
    22482248            aDevice, aControllerPort, aControllerName);
    22492249
    2250     (*it)->hardDisk().queryInterfaceTo (aHardDisk);
     2250    (*it)->hardDisk().queryInterfaceTo(aHardDisk);
    22512251
    22522252    return S_OK;
     
    22612261                     aControllerName, aControllerPort, aDevice));
    22622262
    2263     AutoCaller autoCaller (this);
    2264     CheckComRCReturnRC (autoCaller.rc());
    2265 
    2266     AutoWriteLock alock (this);
    2267 
    2268     HRESULT rc = checkStateDependency (MutableStateDep);
    2269     CheckComRCReturnRC (rc);
    2270 
    2271     AssertReturn (mData->mMachineState != MachineState_Saved, E_FAIL);
     2263    AutoCaller autoCaller(this);
     2264    CheckComRCReturnRC(autoCaller.rc());
     2265
     2266    AutoWriteLock alock(this);
     2267
     2268    HRESULT rc = checkStateDependency(MutableStateDep);
     2269    CheckComRCReturnRC(rc);
     2270
     2271    AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL);
    22722272
    22732273    if (Global::IsOnlineOrTransient (mData->mMachineState))
     
    23112311        setMachineState (oldState);
    23122312
    2313         CheckComRCReturnRC (rc);
     2313        CheckComRCReturnRC(rc);
    23142314    }
    23152315
     
    23262326STDMETHODIMP Machine::GetSerialPort (ULONG slot, ISerialPort **port)
    23272327{
    2328     CheckComArgOutPointerValid (port);
     2328    CheckComArgOutPointerValid(port);
    23292329    CheckComArgExpr (slot, slot < RT_ELEMENTS (mSerialPorts));
    23302330
    2331     AutoCaller autoCaller (this);
    2332     CheckComRCReturnRC (autoCaller.rc());
    2333 
    2334     AutoReadLock alock (this);
    2335 
    2336     mSerialPorts [slot].queryInterfaceTo (port);
     2331    AutoCaller autoCaller(this);
     2332    CheckComRCReturnRC(autoCaller.rc());
     2333
     2334    AutoReadLock alock(this);
     2335
     2336    mSerialPorts [slot].queryInterfaceTo(port);
    23372337
    23382338    return S_OK;
     
    23412341STDMETHODIMP Machine::GetParallelPort (ULONG slot, IParallelPort **port)
    23422342{
    2343     CheckComArgOutPointerValid (port);
     2343    CheckComArgOutPointerValid(port);
    23442344    CheckComArgExpr (slot, slot < RT_ELEMENTS (mParallelPorts));
    23452345
    2346     AutoCaller autoCaller (this);
    2347     CheckComRCReturnRC (autoCaller.rc());
    2348 
    2349     AutoReadLock alock (this);
    2350 
    2351     mParallelPorts [slot].queryInterfaceTo (port);
     2346    AutoCaller autoCaller(this);
     2347    CheckComRCReturnRC(autoCaller.rc());
     2348
     2349    AutoReadLock alock(this);
     2350
     2351    mParallelPorts [slot].queryInterfaceTo(port);
    23522352
    23532353    return S_OK;
     
    23562356STDMETHODIMP Machine::GetNetworkAdapter (ULONG slot, INetworkAdapter **adapter)
    23572357{
    2358     CheckComArgOutPointerValid (adapter);
     2358    CheckComArgOutPointerValid(adapter);
    23592359    CheckComArgExpr (slot, slot < RT_ELEMENTS (mNetworkAdapters));
    23602360
    2361     AutoCaller autoCaller (this);
    2362     CheckComRCReturnRC (autoCaller.rc());
    2363 
    2364     AutoReadLock alock (this);
    2365 
    2366     mNetworkAdapters [slot].queryInterfaceTo (adapter);
     2361    AutoCaller autoCaller(this);
     2362    CheckComRCReturnRC(autoCaller.rc());
     2363
     2364    AutoReadLock alock(this);
     2365
     2366    mNetworkAdapters [slot].queryInterfaceTo(adapter);
    23672367
    23682368    return S_OK;
     
    23742374STDMETHODIMP Machine::GetNextExtraDataKey (IN_BSTR aKey, BSTR *aNextKey, BSTR *aNextValue)
    23752375{
    2376     CheckComArgOutPointerValid (aNextKey);
    2377 
    2378     AutoCaller autoCaller (this);
    2379     CheckComRCReturnRC (autoCaller.rc());
     2376    CheckComArgOutPointerValid(aNextKey);
     2377
     2378    AutoCaller autoCaller(this);
     2379    CheckComRCReturnRC(autoCaller.rc());
    23802380
    23812381    /* start with nothing found */
     
    23942394
    23952395    /* serialize file access (prevent writes) */
    2396     AutoReadLock alock (this);
     2396    AutoReadLock alock(this);
    23972397
    23982398    try
     
    24072407
    24082408        rc = VirtualBox::loadSettingsTree_Again (tree, file);
    2409         CheckComRCReturnRC (rc);
     2409        CheckComRCReturnRC(rc);
    24102410
    24112411        Key machineNode = tree.rootKey().key ("Machine");
     
    24252425                    if (bstrInKey.isEmpty())
    24262426                    {
    2427                         key.cloneTo (aNextKey);
     2427                        key.cloneTo(aNextKey);
    24282428                        if (aNextValue)
    24292429                        {
    24302430                            Bstr val = (*it).stringValue ("value");
    2431                             val.cloneTo (aNextValue);
     2431                            val.cloneTo(aNextValue);
    24322432                        }
    24332433                        return S_OK;
     
    24422442                        {
    24432443                            Bstr key = (*it).stringValue ("name");
    2444                             key.cloneTo (aNextKey);
     2444                            key.cloneTo(aNextKey);
    24452445                            if (aNextValue)
    24462446                            {
    24472447                                Bstr val = (*it).stringValue ("value");
    2448                                 val.cloneTo (aNextValue);
     2448                                val.cloneTo(aNextValue);
    24492449                            }
    24502450                        }
     
    24802480{
    24812481    CheckComArgNotNull (aKey);
    2482     CheckComArgOutPointerValid (aValue);
    2483 
    2484     AutoCaller autoCaller (this);
    2485     CheckComRCReturnRC (autoCaller.rc());
     2482    CheckComArgOutPointerValid(aValue);
     2483
     2484    AutoCaller autoCaller(this);
     2485    CheckComRCReturnRC(autoCaller.rc());
    24862486
    24872487    /* serialize file access (prevent writes) */
    2488     AutoReadLock alock (this);
     2488    AutoReadLock alock(this);
    24892489
    24902490    /* start with nothing found */
     
    24992499    HRESULT rc = getExtraData(Utf8Str(aKey), val);
    25002500    if (SUCCEEDED(rc))
    2501         val.cloneTo (aValue);
     2501        val.cloneTo(aValue);
    25022502
    25032503    return rc;
     
    25192519
    25202520        rc = VirtualBox::loadSettingsTree_Again (tree, file);
    2521         CheckComRCReturnRC (rc);
     2521        CheckComRCReturnRC(rc);
    25222522
    25232523        Key machineNode = tree.rootKey().key ("Machine");
     
    25542554    CheckComArgNotNull (aKey);
    25552555
    2556     AutoCaller autoCaller (this);
    2557     CheckComRCReturnRC (autoCaller.rc());
     2556    AutoCaller autoCaller(this);
     2557    CheckComRCReturnRC(autoCaller.rc());
    25582558
    25592559    /* VirtualBox::onExtraDataCanChange() and saveSettings() need mParent
     
    25652565    if (mType == IsSnapshotMachine)
    25662566    {
    2567         HRESULT rc = checkStateDependency (MutableStateDep);
    2568         CheckComRCReturnRC (rc);
     2567        HRESULT rc = checkStateDependency(MutableStateDep);
     2568        CheckComRCReturnRC(rc);
    25692569    }
    25702570
     
    25842584    {
    25852585        rc = saveSettings();
    2586         CheckComRCReturnRC (rc);
     2586        CheckComRCReturnRC(rc);
    25872587    }
    25882588
     
    25972597
    25982598        rc = VirtualBox::loadSettingsTree_ForUpdate (tree, file);
    2599         CheckComRCReturnRC (rc);
     2599        CheckComRCReturnRC(rc);
    26002600
    26012601        const Utf8Str key = aKey;
     
    26582658            rc = VirtualBox::saveSettingsTree (tree, file,
    26592659                                               mData->mSettingsFileVersion);
    2660             CheckComRCReturnRC (rc);
     2660            CheckComRCReturnRC(rc);
    26612661        }
    26622662    }
     
    26672667
    26682668    /* fire a notification */
    2669     if (SUCCEEDED (rc) && changed)
     2669    if (SUCCEEDED(rc) && changed)
    26702670        mParent->onExtraDataChange (mData->mUuid, aKey, aValue);
    26712671
     
    26752675STDMETHODIMP Machine::SaveSettings()
    26762676{
    2677     AutoCaller autoCaller (this);
    2678     CheckComRCReturnRC (autoCaller.rc());
     2677    AutoCaller autoCaller(this);
     2678    CheckComRCReturnRC(autoCaller.rc());
    26792679
    26802680    /* saveSettings() needs mParent lock */
     
    26862686        MutableOrSavedStateDep : MutableStateDep;
    26872687
    2688     HRESULT rc = checkStateDependency (dep);
    2689     CheckComRCReturnRC (rc);
     2688    HRESULT rc = checkStateDependency(dep);
     2689    CheckComRCReturnRC(rc);
    26902690
    26912691    /* the settings file path may never be null */
     
    26982698STDMETHODIMP Machine::SaveSettingsWithBackup (BSTR *aBakFileName)
    26992699{
    2700     CheckComArgOutPointerValid (aBakFileName);
    2701 
    2702     AutoCaller autoCaller (this);
    2703     CheckComRCReturnRC (autoCaller.rc());
     2700    CheckComArgOutPointerValid(aBakFileName);
     2701
     2702    AutoCaller autoCaller(this);
     2703    CheckComRCReturnRC(autoCaller.rc());
    27042704
    27052705    /* saveSettings() needs mParent lock */
     
    27112711        MutableOrSavedStateDep : MutableStateDep;
    27122712
    2713     HRESULT rc = checkStateDependency (dep);
    2714     CheckComRCReturnRC (rc);
     2713    HRESULT rc = checkStateDependency(dep);
     2714    CheckComRCReturnRC(rc);
    27152715
    27162716    /* the settings file path may never be null */
     
    27252725                                                     mData->mSettingsFileVersion,
    27262726                                                     bakFileName);
    2727         CheckComRCReturnRC (rc);
    2728 
    2729         bakFileName.cloneTo (aBakFileName);
     2727        CheckComRCReturnRC(rc);
     2728
     2729        bakFileName.cloneTo(aBakFileName);
    27302730    }
    27312731
     
    27362736STDMETHODIMP Machine::DiscardSettings()
    27372737{
    2738     AutoCaller autoCaller (this);
    2739     CheckComRCReturnRC (autoCaller.rc());
    2740 
    2741     AutoWriteLock alock (this);
    2742 
    2743     HRESULT rc = checkStateDependency (MutableStateDep);
    2744     CheckComRCReturnRC (rc);
     2738    AutoCaller autoCaller(this);
     2739    CheckComRCReturnRC(autoCaller.rc());
     2740
     2741    AutoWriteLock alock(this);
     2742
     2743    HRESULT rc = checkStateDependency(MutableStateDep);
     2744    CheckComRCReturnRC(rc);
    27452745
    27462746    /*
     
    27552755STDMETHODIMP Machine::DeleteSettings()
    27562756{
    2757     AutoCaller autoCaller (this);
    2758     CheckComRCReturnRC (autoCaller.rc());
    2759 
    2760     AutoWriteLock alock (this);
    2761 
    2762     HRESULT rc = checkStateDependency (MutableStateDep);
    2763     CheckComRCReturnRC (rc);
     2757    AutoCaller autoCaller(this);
     2758    CheckComRCReturnRC(autoCaller.rc());
     2759
     2760    AutoWriteLock alock(this);
     2761
     2762    HRESULT rc = checkStateDependency(MutableStateDep);
     2763    CheckComRCReturnRC(rc);
    27642764
    27652765    if (mData->mRegistered)
     
    27722772        unlockConfig();
    27732773        int vrc = RTFileDelete (Utf8Str (mData->mConfigFileFull));
    2774         if (RT_FAILURE (vrc))
     2774        if (RT_FAILURE(vrc))
    27752775            return setError (VBOX_E_IPRT_ERROR,
    27762776                tr ("Could not delete the settings file '%ls' (%Rrc)"),
     
    28272827STDMETHODIMP Machine::GetSnapshot (IN_BSTR aId, ISnapshot **aSnapshot)
    28282828{
    2829     CheckComArgOutPointerValid (aSnapshot);
    2830 
    2831     AutoCaller autoCaller (this);
    2832     CheckComRCReturnRC (autoCaller.rc());
    2833 
    2834     AutoReadLock alock (this);
     2829    CheckComArgOutPointerValid(aSnapshot);
     2830
     2831    AutoCaller autoCaller(this);
     2832    CheckComRCReturnRC(autoCaller.rc());
     2833
     2834    AutoReadLock alock(this);
    28352835
    28362836    Guid id(aId);
    2837     ComObjPtr <Snapshot> snapshot;
     2837    ComObjPtr<Snapshot> snapshot;
    28382838
    28392839    HRESULT rc = findSnapshot (id, snapshot, true /* aSetError */);
    2840     snapshot.queryInterfaceTo (aSnapshot);
     2840    snapshot.queryInterfaceTo(aSnapshot);
    28412841
    28422842    return rc;
     
    28462846{
    28472847    CheckComArgNotNull (aName);
    2848     CheckComArgOutPointerValid (aSnapshot);
    2849 
    2850     AutoCaller autoCaller (this);
    2851     CheckComRCReturnRC (autoCaller.rc());
    2852 
    2853     AutoReadLock alock (this);
    2854 
    2855     ComObjPtr <Snapshot> snapshot;
     2848    CheckComArgOutPointerValid(aSnapshot);
     2849
     2850    AutoCaller autoCaller(this);
     2851    CheckComRCReturnRC(autoCaller.rc());
     2852
     2853    AutoReadLock alock(this);
     2854
     2855    ComObjPtr<Snapshot> snapshot;
    28562856
    28572857    HRESULT rc = findSnapshot (aName, snapshot, true /* aSetError */);
    2858     snapshot.queryInterfaceTo (aSnapshot);
     2858    snapshot.queryInterfaceTo(aSnapshot);
    28592859
    28602860    return rc;
     
    28752875    CheckComArgNotNull (aHostPath);
    28762876
    2877     AutoCaller autoCaller (this);
    2878     CheckComRCReturnRC (autoCaller.rc());
    2879 
    2880     AutoWriteLock alock (this);
    2881 
    2882     HRESULT rc = checkStateDependency (MutableStateDep);
    2883     CheckComRCReturnRC (rc);
    2884 
    2885     ComObjPtr <SharedFolder> sharedFolder;
     2877    AutoCaller autoCaller(this);
     2878    CheckComRCReturnRC(autoCaller.rc());
     2879
     2880    AutoWriteLock alock(this);
     2881
     2882    HRESULT rc = checkStateDependency(MutableStateDep);
     2883    CheckComRCReturnRC(rc);
     2884
     2885    ComObjPtr<SharedFolder> sharedFolder;
    28862886    rc = findSharedFolder (aName, sharedFolder, false /* aSetError */);
    2887     if (SUCCEEDED (rc))
     2887    if (SUCCEEDED(rc))
    28882888        return setError (VBOX_E_OBJECT_IN_USE,
    28892889            tr ("Shared folder named '%ls' already exists"), aName);
     
    28912891    sharedFolder.createObject();
    28922892    rc = sharedFolder->init (machine(), aName, aHostPath, aWritable);
    2893     CheckComRCReturnRC (rc);
     2893    CheckComRCReturnRC(rc);
    28942894
    28952895    mHWData.backup();
     
    29072907    CheckComArgNotNull (aName);
    29082908
    2909     AutoCaller autoCaller (this);
    2910     CheckComRCReturnRC (autoCaller.rc());
    2911 
    2912     AutoWriteLock alock (this);
    2913 
    2914     HRESULT rc = checkStateDependency (MutableStateDep);
    2915     CheckComRCReturnRC (rc);
    2916 
    2917     ComObjPtr <SharedFolder> sharedFolder;
     2909    AutoCaller autoCaller(this);
     2910    CheckComRCReturnRC(autoCaller.rc());
     2911
     2912    AutoWriteLock alock(this);
     2913
     2914    HRESULT rc = checkStateDependency(MutableStateDep);
     2915    CheckComRCReturnRC(rc);
     2916
     2917    ComObjPtr<SharedFolder> sharedFolder;
    29182918    rc = findSharedFolder (aName, sharedFolder, true /* aSetError */);
    2919     CheckComRCReturnRC (rc);
     2919    CheckComRCReturnRC(rc);
    29202920
    29212921    mHWData.backup();
     
    29312931STDMETHODIMP Machine::CanShowConsoleWindow (BOOL *aCanShow)
    29322932{
    2933     CheckComArgOutPointerValid (aCanShow);
     2933    CheckComArgOutPointerValid(aCanShow);
    29342934
    29352935    /* start with No */
    29362936    *aCanShow = FALSE;
    29372937
    2938     AutoCaller autoCaller (this);
    2939     AssertComRCReturnRC (autoCaller.rc());
    2940 
    2941     ComPtr <IInternalSessionControl> directControl;
    2942     {
    2943         AutoReadLock alock (this);
     2938    AutoCaller autoCaller(this);
     2939    AssertComRCReturnRC(autoCaller.rc());
     2940
     2941    ComPtr<IInternalSessionControl> directControl;
     2942    {
     2943        AutoReadLock alock(this);
    29442944
    29452945        if (mData->mSession.mState != SessionState_Open)
     
    29612961STDMETHODIMP Machine::ShowConsoleWindow (ULONG64 *aWinId)
    29622962{
    2963     CheckComArgOutPointerValid (aWinId);
    2964 
    2965     AutoCaller autoCaller (this);
     2963    CheckComArgOutPointerValid(aWinId);
     2964
     2965    AutoCaller autoCaller(this);
    29662966    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    29672967
    2968     ComPtr <IInternalSessionControl> directControl;
    2969     {
    2970         AutoReadLock alock (this);
     2968    ComPtr<IInternalSessionControl> directControl;
     2969    {
     2970        AutoReadLock alock(this);
    29712971
    29722972        if (mData->mSession.mState != SessionState_Open)
     
    29922992#else
    29932993    CheckComArgNotNull (aName);
    2994     CheckComArgOutPointerValid (aValue);
    2995     CheckComArgOutPointerValid (aTimestamp);
    2996     CheckComArgOutPointerValid (aFlags);
    2997 
    2998     AutoCaller autoCaller (this);
    2999     CheckComRCReturnRC (autoCaller.rc());
    3000 
    3001     AutoReadLock alock (this);
     2994    CheckComArgOutPointerValid(aValue);
     2995    CheckComArgOutPointerValid(aTimestamp);
     2996    CheckComArgOutPointerValid(aFlags);
     2997
     2998    AutoCaller autoCaller(this);
     2999    CheckComRCReturnRC(autoCaller.rc());
     3000
     3001    AutoReadLock alock(this);
    30023002
    30033003    using namespace guestProp;
     
    30133013            {
    30143014                char szFlags[MAX_FLAGS_LEN + 1];
    3015                 it->mValue.cloneTo (aValue);
     3015                it->mValue.cloneTo(aValue);
    30163016                *aTimestamp = it->mTimestamp;
    30173017                writeFlags (it->mFlags, szFlags);
    3018                 Bstr (szFlags).cloneTo (aFlags);
     3018                Bstr (szFlags).cloneTo(aFlags);
    30193019                found = true;
    30203020            }
     
    30243024    else
    30253025    {
    3026         ComPtr <IInternalSessionControl> directControl =
     3026        ComPtr<IInternalSessionControl> directControl =
    30273027            mData->mSession.mDirectControl;
    30283028
     
    30863086        uint32_t fFlags = NILFLAG;
    30873087        if (    (aFlags != NULL)
    3088              && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags))
     3088             && RT_FAILURE(validateFlags (utf8Flags.raw(), &fFlags))
    30893089           )
    30903090            return setError(E_INVALIDARG,
     
    30983098
    30993099        rc = checkStateDependency(MutableStateDep);
    3100         CheckComRCReturnRC (rc);
     3100        CheckComRCReturnRC(rc);
    31013101
    31023102        rc = S_OK;
     
    31113111                              tr("Cannot set a transient property when the machine is not running"));
    31123112
    3113             if (SUCCEEDED (rc))
     3113            if (SUCCEEDED(rc))
    31143114            {
    31153115                for (HWData::GuestPropertyList::iterator it =
     
    31373137                    }
    31383138            }
    3139             if (found && SUCCEEDED (rc))
     3139            if (found && SUCCEEDED(rc))
    31403140            {
    31413141                if (*aValue)
     
    31433143                    RTTIMESPEC time;
    31443144                    property.mValue = aValue;
    3145                     property.mTimestamp = RTTimeSpecGetNano (RTTimeNow (&time));
     3145                    property.mTimestamp = RTTimeSpecGetNano(RTTimeNow (&time));
    31463146                    if (aFlags != NULL)
    31473147                        property.mFlags = fFlags;
     
    31493149                }
    31503150            }
    3151             else if (SUCCEEDED (rc) && *aValue)
     3151            else if (SUCCEEDED(rc) && *aValue)
    31523152            {
    31533153                RTTIMESPEC time;
     
    31553155                property.mName = aName;
    31563156                property.mValue = aValue;
    3157                 property.mTimestamp = RTTimeSpecGetNano (RTTimeNow (&time));
     3157                property.mTimestamp = RTTimeSpecGetNano(RTTimeNow (&time));
    31583158                property.mFlags = fFlags;
    31593159                mHWData->mGuestProperties.push_back (property);
    31603160            }
    3161             if (   SUCCEEDED (rc)
     3161            if (   SUCCEEDED(rc)
    31623162                && (   matchAll
    31633163                    || RTStrSimplePatternMultiMatch (utf8Patterns.raw(), RTSTR_MAX,
     
    31693169        else
    31703170        {
    3171             ComPtr <IInternalSessionControl> directControl =
     3171            ComPtr<IInternalSessionControl> directControl =
    31723172                mData->mSession.mDirectControl;
    31733173
     
    32003200
    32013201STDMETHODIMP Machine::
    3202 EnumerateGuestProperties (IN_BSTR aPatterns, ComSafeArrayOut (BSTR, aNames),
    3203                           ComSafeArrayOut (BSTR, aValues),
    3204                           ComSafeArrayOut (ULONG64, aTimestamps),
    3205                           ComSafeArrayOut (BSTR, aFlags))
     3202EnumerateGuestProperties (IN_BSTR aPatterns, ComSafeArrayOut(BSTR, aNames),
     3203                          ComSafeArrayOut(BSTR, aValues),
     3204                          ComSafeArrayOut(ULONG64, aTimestamps),
     3205                          ComSafeArrayOut(BSTR, aFlags))
    32063206{
    32073207#if !defined (VBOX_WITH_GUEST_PROPS)
     
    32113211        return E_POINTER;
    32123212
    3213     CheckComArgOutSafeArrayPointerValid (aNames);
    3214     CheckComArgOutSafeArrayPointerValid (aValues);
    3215     CheckComArgOutSafeArrayPointerValid (aTimestamps);
    3216     CheckComArgOutSafeArrayPointerValid (aFlags);
    3217 
    3218     AutoCaller autoCaller (this);
    3219     CheckComRCReturnRC (autoCaller.rc());
    3220 
    3221     AutoReadLock alock (this);
     3213    CheckComArgOutSafeArrayPointerValid(aNames);
     3214    CheckComArgOutSafeArrayPointerValid(aValues);
     3215    CheckComArgOutSafeArrayPointerValid(aTimestamps);
     3216    CheckComArgOutSafeArrayPointerValid(aFlags);
     3217
     3218    AutoCaller autoCaller(this);
     3219    CheckComRCReturnRC(autoCaller.rc());
     3220
     3221    AutoReadLock alock(this);
    32223222
    32233223    using namespace guestProp;
     
    32483248 */
    32493249        size_t cEntries = propList.size();
    3250         SafeArray <BSTR> names (cEntries);
    3251         SafeArray <BSTR> values (cEntries);
    3252         SafeArray <ULONG64> timestamps (cEntries);
    3253         SafeArray <BSTR> flags (cEntries);
     3250        SafeArray<BSTR> names (cEntries);
     3251        SafeArray<BSTR> values (cEntries);
     3252        SafeArray<ULONG64> timestamps (cEntries);
     3253        SafeArray<BSTR> flags (cEntries);
    32543254        size_t iProp = 0;
    32553255        for (HWData::GuestPropertyList::iterator it = propList.begin();
     
    32573257        {
    32583258             char szFlags[MAX_FLAGS_LEN + 1];
    3259              it->mName.cloneTo (&names[iProp]);
    3260              it->mValue.cloneTo (&values[iProp]);
     3259             it->mName.cloneTo(&names[iProp]);
     3260             it->mValue.cloneTo(&values[iProp]);
    32613261             timestamps[iProp] = it->mTimestamp;
    32623262             writeFlags (it->mFlags, szFlags);
    3263              Bstr (szFlags).cloneTo (&flags[iProp]);
     3263             Bstr (szFlags).cloneTo(&flags[iProp]);
    32643264             ++iProp;
    32653265        }
    3266         names.detachTo (ComSafeArrayOutArg (aNames));
    3267         values.detachTo (ComSafeArrayOutArg (aValues));
    3268         timestamps.detachTo (ComSafeArrayOutArg (aTimestamps));
    3269         flags.detachTo (ComSafeArrayOutArg (aFlags));
     3266        names.detachTo(ComSafeArrayOutArg(aNames));
     3267        values.detachTo(ComSafeArrayOutArg(aValues));
     3268        timestamps.detachTo(ComSafeArrayOutArg(aTimestamps));
     3269        flags.detachTo(ComSafeArrayOutArg(aFlags));
    32703270        rc = S_OK;
    32713271    }
    32723272    else
    32733273    {
    3274         ComPtr <IInternalSessionControl> directControl =
     3274        ComPtr<IInternalSessionControl> directControl =
    32753275            mData->mSession.mDirectControl;
    32763276
     
    32823282        else
    32833283            rc = directControl->EnumerateGuestProperties (aPatterns,
    3284                                                           ComSafeArrayOutArg (aNames),
    3285                                                           ComSafeArrayOutArg (aValues),
    3286                                                           ComSafeArrayOutArg (aTimestamps),
    3287                                                           ComSafeArrayOutArg (aFlags));
     3284                                                          ComSafeArrayOutArg(aNames),
     3285                                                          ComSafeArrayOutArg(aValues),
     3286                                                          ComSafeArrayOutArg(aTimestamps),
     3287                                                          ComSafeArrayOutArg(aFlags));
    32883288    }
    32893289    return rc;
     
    32923292
    32933293STDMETHODIMP Machine::
    3294 GetHardDiskAttachmentsOfController(IN_BSTR aName, ComSafeArrayOut (IHardDiskAttachment *, aAttachments))
     3294GetHardDiskAttachmentsOfController(IN_BSTR aName, ComSafeArrayOut(IHardDiskAttachment *, aAttachments))
    32953295{
    32963296    HDData::AttachmentList atts;
     
    33003300
    33013301    SafeIfaceArray<IHardDiskAttachment> attachments (atts);
    3302     attachments.detachTo (ComSafeArrayOutArg (aAttachments));
     3302    attachments.detachTo(ComSafeArrayOutArg(aAttachments));
    33033303
    33043304    return S_OK;
     
    33183318                aConnectionType);
    33193319
    3320     AutoCaller autoCaller (this);
    3321     CheckComRCReturnRC (autoCaller.rc());
    3322 
    3323     AutoWriteLock alock (this);
    3324 
    3325     HRESULT rc = checkStateDependency (MutableStateDep);
    3326     CheckComRCReturnRC (rc);
     3320    AutoCaller autoCaller(this);
     3321    CheckComRCReturnRC(autoCaller.rc());
     3322
     3323    AutoWriteLock alock(this);
     3324
     3325    HRESULT rc = checkStateDependency(MutableStateDep);
     3326    CheckComRCReturnRC(rc);
    33273327
    33283328    /* try to find one with the name first. */
     
    33303330
    33313331    rc = getStorageControllerByName (aName, ctrl, false /* aSetError */);
    3332     if (SUCCEEDED (rc))
     3332    if (SUCCEEDED(rc))
    33333333        return setError (VBOX_E_OBJECT_IN_USE,
    33343334            tr ("Storage controller named '%ls' already exists"), aName);
     
    33363336    ctrl.createObject();
    33373337    rc = ctrl->init (this, aName, aConnectionType);
    3338     CheckComRCReturnRC (rc);
     3338    CheckComRCReturnRC(rc);
    33393339
    33403340    mStorageControllers.backup();
     
    33553355    CheckComArgStrNotEmptyOrNull(aName);
    33563356
    3357     AutoCaller autoCaller (this);
    3358     CheckComRCReturnRC (autoCaller.rc());
    3359 
    3360     AutoReadLock alock (this);
    3361 
    3362     ComObjPtr <StorageController> ctrl;
     3357    AutoCaller autoCaller(this);
     3358    CheckComRCReturnRC(autoCaller.rc());
     3359
     3360    AutoReadLock alock(this);
     3361
     3362    ComObjPtr<StorageController> ctrl;
    33633363
    33643364    HRESULT rc = getStorageControllerByName (aName, ctrl, true /* aSetError */);
    3365     if (SUCCEEDED (rc))
    3366         ctrl.queryInterfaceTo (aStorageController);
     3365    if (SUCCEEDED(rc))
     3366        ctrl.queryInterfaceTo(aStorageController);
    33673367
    33683368    return rc;
     
    33743374    CheckComArgStrNotEmptyOrNull(aName);
    33753375
    3376     AutoCaller autoCaller (this);
    3377     CheckComRCReturnRC (autoCaller.rc());
    3378 
    3379     AutoWriteLock alock (this);
    3380 
    3381     HRESULT rc = checkStateDependency (MutableStateDep);
    3382     CheckComRCReturnRC (rc);
    3383 
    3384     ComObjPtr <StorageController> ctrl;
     3376    AutoCaller autoCaller(this);
     3377    CheckComRCReturnRC(autoCaller.rc());
     3378
     3379    AutoWriteLock alock(this);
     3380
     3381    HRESULT rc = checkStateDependency(MutableStateDep);
     3382    CheckComRCReturnRC(rc);
     3383
     3384    ComObjPtr<StorageController> ctrl;
    33853385    rc = getStorageControllerByName (aName, ctrl, true /* aSetError */);
    3386     CheckComRCReturnRC (rc);
     3386    CheckComRCReturnRC(rc);
    33873387
    33883388    /* We can remove the controller only if there is no device attached. */
     
    34273427HRESULT Machine::saveRegistryEntry (settings::Key &aEntryNode)
    34283428{
    3429     AssertReturn (!aEntryNode.isNull(), E_FAIL);
    3430 
    3431     AutoLimitedCaller autoCaller (this);
    3432     AssertComRCReturnRC (autoCaller.rc());
    3433 
    3434     AutoReadLock alock (this);
     3429    AssertReturn(!aEntryNode.isNull(), E_FAIL);
     3430
     3431    AutoLimitedCaller autoCaller(this);
     3432    AssertComRCReturnRC(autoCaller.rc());
     3433
     3434    AutoReadLock alock(this);
    34353435
    34363436    /* UUID */
     
    34553455int Machine::calculateFullPath (const char *aPath, Utf8Str &aResult)
    34563456{
    3457     AutoCaller autoCaller (this);
     3457    AutoCaller autoCaller(this);
    34583458    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    34593459
    3460     AutoReadLock alock (this);
    3461 
    3462     AssertReturn (!mData->mConfigFileFull.isNull(), VERR_GENERAL_FAILURE);
     3460    AutoReadLock alock(this);
     3461
     3462    AssertReturn(!mData->mConfigFileFull.isNull(), VERR_GENERAL_FAILURE);
    34633463
    34643464    Utf8Str strSettingsDir = mData->mConfigFileFull;
     
    34863486void Machine::calculateRelativePath (const char *aPath, Utf8Str &aResult)
    34873487{
    3488     AutoCaller autoCaller (this);
     3488    AutoCaller autoCaller(this);
    34893489    AssertComRCReturn (autoCaller.rc(), (void) 0);
    34903490
    3491     AutoReadLock alock (this);
     3491    AutoReadLock alock(this);
    34923492
    34933493    AssertReturnVoid (!mData->mConfigFileFull.isNull());
     
    35133513void Machine::getLogFolder (Utf8Str &aLogFolder)
    35143514{
    3515     AutoCaller autoCaller (this);
     3515    AutoCaller autoCaller(this);
    35163516    AssertComRCReturnVoid (autoCaller.rc());
    35173517
    3518     AutoReadLock alock (this);
     3518    AutoReadLock alock(this);
    35193519
    35203520    Utf8Str settingsDir;
     
    35413541    LogFlowThisFuncEnter();
    35423542
    3543     AssertReturn (aControl, E_FAIL);
    3544 
    3545     AutoCaller autoCaller (this);
    3546     CheckComRCReturnRC (autoCaller.rc());
    3547 
    3548     AutoWriteLock alock (this);
     3543    AssertReturn(aControl, E_FAIL);
     3544
     3545    AutoCaller autoCaller(this);
     3546    CheckComRCReturnRC(autoCaller.rc());
     3547
     3548    AutoWriteLock alock(this);
    35493549
    35503550    if (!mData->mRegistered)
     
    35523552            tr ("The machine '%ls' is not registered"), mUserData->mName.raw());
    35533553
    3554     LogFlowThisFunc (("mSession.mState=%d\n", mData->mSession.mState));
     3554    LogFlowThisFunc(("mSession.mState=%d\n", mData->mSession.mState));
    35553555
    35563556    if (mData->mSession.mState == SessionState_Open ||
     
    35623562
    35633563    /* may not be busy */
    3564     AssertReturn (!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
     3564    AssertReturn(!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
    35653565
    35663566    /* get the session PID */
     
    35763576         * started by #openRemoteSession(). */
    35773577
    3578         LogFlowThisFunc (("mSession.mPid=%d(0x%x)\n",
     3578        LogFlowThisFunc(("mSession.mPid=%d(0x%x)\n",
    35793579                          mData->mSession.mPid, mData->mSession.mPid));
    3580         LogFlowThisFunc (("session.pid=%d(0x%x)\n", pid, pid));
     3580        LogFlowThisFunc(("session.pid=%d(0x%x)\n", pid, pid));
    35813581
    35823582        if (mData->mSession.mPid != pid)
     
    35893589
    35903590    /* create a SessionMachine object */
    3591     ComObjPtr <SessionMachine> sessionMachine;
     3591    ComObjPtr<SessionMachine> sessionMachine;
    35923592    sessionMachine.createObject();
    35933593    HRESULT rc = sessionMachine->init (this);
     
    36003600     * is possible due to the wrong lock order. */
    36013601
    3602     if (SUCCEEDED (rc))
     3602    if (SUCCEEDED(rc))
    36033603    {
    36043604#ifdef VBOX_WITH_RESOURCE_USAGE_API
     
    36263626        alock.leave();
    36273627
    3628         LogFlowThisFunc (("Calling AssignMachine()...\n"));
     3628        LogFlowThisFunc(("Calling AssignMachine()...\n"));
    36293629        rc = aControl->AssignMachine (sessionMachine);
    3630         LogFlowThisFunc (("AssignMachine() returned %08X\n", rc));
     3630        LogFlowThisFunc(("AssignMachine() returned %08X\n", rc));
    36313631
    36323632        /* The failure may occur w/o any error info (from RPC), so provide one */
     
    36353635                tr ("Failed to assign the machine to the session (%Rrc)"), rc);
    36363636
    3637         if (SUCCEEDED (rc) && origState == SessionState_Spawning)
     3637        if (SUCCEEDED(rc) && origState == SessionState_Spawning)
    36383638        {
    36393639            /* complete the remote session initialization */
    36403640
    36413641            /* get the console from the direct session */
    3642             ComPtr <IConsole> console;
     3642            ComPtr<IConsole> console;
    36433643            rc = aControl->GetRemoteConsole (console.asOutParam());
    36443644            ComAssertComRC (rc);
    36453645
    3646             if (SUCCEEDED (rc) && !console)
     3646            if (SUCCEEDED(rc) && !console)
    36473647            {
    36483648                ComAssert (!!console);
     
    36513651
    36523652            /* assign machine & console to the remote session */
    3653             if (SUCCEEDED (rc))
     3653            if (SUCCEEDED(rc))
    36543654            {
    36553655                /*
     
    36573657                 *  entry in remoteControls is that remote session
    36583658                 */
    3659                 LogFlowThisFunc (("Calling AssignRemoteMachine()...\n"));
     3659                LogFlowThisFunc(("Calling AssignRemoteMachine()...\n"));
    36603660                rc = mData->mSession.mRemoteControls.front()->
    36613661                    AssignRemoteMachine (sessionMachine, console);
    3662                 LogFlowThisFunc (("AssignRemoteMachine() returned %08X\n", rc));
     3662                LogFlowThisFunc(("AssignRemoteMachine() returned %08X\n", rc));
    36633663
    36643664                /* The failure may occur w/o any error info (from RPC), so provide one */
     
    37073707    {
    37083708        /* memorize PID of the directly opened session */
    3709         if (SUCCEEDED (rc))
     3709        if (SUCCEEDED(rc))
    37103710            mData->mSession.mPid = pid;
    37113711    }
    37123712
    3713     if (SUCCEEDED (rc))
     3713    if (SUCCEEDED(rc))
    37143714    {
    37153715        /* memorize the direct session control and cache IUnknown for it */
     
    37223722         * identity checks (it will be internally cached within mDirectControl
    37233723         * at least on XPCOM) */
    3724         ComPtr <IUnknown> unk = mData->mSession.mDirectControl;
     3724        ComPtr<IUnknown> unk = mData->mSession.mDirectControl;
    37253725        NOREF (unk);
    37263726    }
     
    37413741        sessionMachine->uninit();
    37423742
    3743     LogFlowThisFunc (("rc=%08X\n", rc));
     3743    LogFlowThisFunc(("rc=%08X\n", rc));
    37443744    LogFlowThisFuncLeave();
    37453745    return rc;
     
    37563756    LogFlowThisFuncEnter();
    37573757
    3758     AssertReturn (aControl, E_FAIL);
    3759     AssertReturn (aProgress, E_FAIL);
    3760 
    3761     AutoCaller autoCaller (this);
    3762     CheckComRCReturnRC (autoCaller.rc());
    3763 
    3764     AutoWriteLock alock (this);
     3758    AssertReturn(aControl, E_FAIL);
     3759    AssertReturn(aProgress, E_FAIL);
     3760
     3761    AutoCaller autoCaller(this);
     3762    CheckComRCReturnRC(autoCaller.rc());
     3763
     3764    AutoWriteLock alock(this);
    37653765
    37663766    if (!mData->mRegistered)
     
    37683768            tr ("The machine '%ls' is not registered"), mUserData->mName.raw());
    37693769
    3770     LogFlowThisFunc (("mSession.mState=%d\n", mData->mSession.mState));
     3770    LogFlowThisFunc(("mSession.mState=%d\n", mData->mSession.mState));
    37713771
    37723772    if (mData->mSession.mState == SessionState_Open ||
     
    37793779
    37803780    /* may not be busy */
    3781     AssertReturn (!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
     3781    AssertReturn(!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
    37823782
    37833783    /* get the path to the executable */
     
    38273827                        else
    38283828                            vrc2 = RTEnvUnsetEx (env, var);
    3829                         if (RT_FAILURE (vrc2))
     3829                        if (RT_FAILURE(vrc2))
    38303830                            break;
    38313831                    }
     
    38333833                }
    38343834            }
    3835             if (RT_SUCCESS (vrc2) && *var)
     3835            if (RT_SUCCESS(vrc2) && *var)
    38363836                vrc2 = RTEnvPutEx (env, var);
    38373837
     
    39453945    RTEnvDestroy (env);
    39463946
    3947     if (RT_FAILURE (vrc))
     3947    if (RT_FAILURE(vrc))
    39483948        return setError (VBOX_E_IPRT_ERROR,
    39493949            tr ("Could not launch a process for the machine '%ls' (%Rrc)"),
    39503950            mUserData->mName.raw(), vrc);
    39513951
    3952     LogFlowThisFunc (("launched.pid=%d(0x%x)\n", pid, pid));
     3952    LogFlowThisFunc(("launched.pid=%d(0x%x)\n", pid, pid));
    39533953
    39543954    /*
     
    39623962
    39633963    /* inform the session that it will be a remote one */
    3964     LogFlowThisFunc (("Calling AssignMachine (NULL)...\n"));
     3964    LogFlowThisFunc(("Calling AssignMachine (NULL)...\n"));
    39653965    HRESULT rc = aControl->AssignMachine (NULL);
    3966     LogFlowThisFunc (("AssignMachine (NULL) returned %08X\n", rc));
     3966    LogFlowThisFunc(("AssignMachine (NULL) returned %08X\n", rc));
    39673967
    39683968    if (FAILED (rc))
     
    39953995    LogFlowThisFuncEnter();
    39963996
    3997     AssertReturn (aControl, E_FAIL);
    3998 
    3999     AutoCaller autoCaller (this);
    4000     CheckComRCReturnRC (autoCaller.rc());
    4001 
    4002     AutoWriteLock alock (this);
     3997    AssertReturn(aControl, E_FAIL);
     3998
     3999    AutoCaller autoCaller(this);
     4000    CheckComRCReturnRC(autoCaller.rc());
     4001
     4002    AutoWriteLock alock(this);
    40034003
    40044004    if (!mData->mRegistered)
     
    40064006            tr ("The machine '%ls' is not registered"), mUserData->mName.raw());
    40074007
    4008     LogFlowThisFunc (("mSession.state=%d\n", mData->mSession.mState));
     4008    LogFlowThisFunc(("mSession.state=%d\n", mData->mSession.mState));
    40094009
    40104010    if (mData->mSession.mState != SessionState_Open)
     
    40194019     *  lock here because GetRemoteConsole must not call us back).
    40204020     */
    4021     ComPtr <IConsole> console;
     4021    ComPtr<IConsole> console;
    40224022    HRESULT rc = mData->mSession.mDirectControl->
    40234023                     GetRemoteConsole (console.asOutParam());
     
    40314031    ComAssertRet (!console.isNull(), E_FAIL);
    40324032
    4033     ComObjPtr <SessionMachine> sessionMachine = mData->mSession.mMachine;
    4034     AssertReturn (!sessionMachine.isNull(), E_FAIL);
     4033    ComObjPtr<SessionMachine> sessionMachine = mData->mSession.mMachine;
     4034    AssertReturn(!sessionMachine.isNull(), E_FAIL);
    40354035
    40364036    /*
     
    40434043
    40444044    /* attach the remote session to the machine */
    4045     LogFlowThisFunc (("Calling AssignRemoteMachine()...\n"));
     4045    LogFlowThisFunc(("Calling AssignRemoteMachine()...\n"));
    40464046    rc = aControl->AssignRemoteMachine (sessionMachine, console);
    4047     LogFlowThisFunc (("AssignRemoteMachine() returned %08X\n", rc));
     4047    LogFlowThisFunc(("AssignRemoteMachine() returned %08X\n", rc));
    40484048
    40494049    /* The failure may occur w/o any error info (from RPC), so provide one */
     
    40854085 */
    40864086#if defined (RT_OS_WINDOWS)
    4087 bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    4088                              ComPtr <IInternalSessionControl> *aControl /*= NULL*/,
     4087bool Machine::isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     4088                             ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
    40894089                             HANDLE *aIPCSem /*= NULL*/,
    40904090                             bool aAllowClosing /*= false*/)
    40914091#elif defined (RT_OS_OS2)
    4092 bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    4093                              ComPtr <IInternalSessionControl> *aControl /*= NULL*/,
     4092bool Machine::isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     4093                             ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
    40944094                             HMTX *aIPCSem /*= NULL*/,
    40954095                             bool aAllowClosing /*= false*/)
    40964096#else
    4097 bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    4098                              ComPtr <IInternalSessionControl> *aControl /*= NULL*/,
     4097bool Machine::isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     4098                             ComPtr<IInternalSessionControl> *aControl /*= NULL*/,
    40994099                             bool aAllowClosing /*= false*/)
    41004100#endif
    41014101{
    4102     AutoLimitedCaller autoCaller (this);
     4102    AutoLimitedCaller autoCaller(this);
    41034103    AssertComRCReturn (autoCaller.rc(), false);
    41044104
     
    41074107        return false;
    41084108
    4109     AutoReadLock alock (this);
     4109    AutoReadLock alock(this);
    41104110
    41114111    if (mData->mSession.mState == SessionState_Open ||
    41124112        (aAllowClosing && mData->mSession.mState == SessionState_Closing))
    41134113    {
    4114         AssertReturn (!mData->mSession.mMachine.isNull(), false);
     4114        AssertReturn(!mData->mSession.mMachine.isNull(), false);
    41154115
    41164116        aMachine = mData->mSession.mMachine;
     
    41464146#endif
    41474147{
    4148     AutoLimitedCaller autoCaller (this);
     4148    AutoLimitedCaller autoCaller(this);
    41494149    AssertComRCReturn (autoCaller.rc(), false);
    41504150
     
    41534153        return false;
    41544154
    4155     AutoReadLock alock (this);
     4155    AutoReadLock alock(this);
    41564156
    41574157    if (mData->mSession.mState == SessionState_Spawning)
     
    41614161        if (aPID != NULL)
    41624162        {
    4163             AssertReturn (mData->mSession.mPid != NIL_RTPROCESS, false);
     4163            AssertReturn(mData->mSession.mPid != NIL_RTPROCESS, false);
    41644164            *aPID = mData->mSession.mPid;
    41654165        }
     
    41874187bool Machine::checkForSpawnFailure()
    41884188{
    4189     AutoCaller autoCaller (this);
     4189    AutoCaller autoCaller(this);
    41904190    if (!autoCaller.isOk())
    41914191    {
    41924192        /* nothing to do */
    4193         LogFlowThisFunc (("Already uninitialized!"));
     4193        LogFlowThisFunc(("Already uninitialized!"));
    41944194        return true;
    41954195    }
     
    42014201    {
    42024202        /* nothing to do */
    4203         LogFlowThisFunc (("Not spawning any more!"));
     4203        LogFlowThisFunc(("Not spawning any more!"));
    42044204        return true;
    42054205    }
     
    42744274HRESULT Machine::trySetRegistered (BOOL aRegistered)
    42754275{
    4276     AssertReturn (mParent->isWriteLockOnCurrentThread(), E_FAIL);
    4277 
    4278     AutoLimitedCaller autoCaller (this);
    4279     AssertComRCReturnRC (autoCaller.rc());
    4280 
    4281     AutoWriteLock alock (this);
     4276    AssertReturn(mParent->isWriteLockOnCurrentThread(), E_FAIL);
     4277
     4278    AutoLimitedCaller autoCaller(this);
     4279    AssertComRCReturnRC(autoCaller.rc());
     4280
     4281    AutoWriteLock alock(this);
    42824282
    42834283    /* wait for state dependants to drop to zero */
     
    42914291
    42924292        /* inaccessible machines can only be unregistered */
    4293         AssertReturn (!aRegistered, E_FAIL);
     4293        AssertReturn(!aRegistered, E_FAIL);
    42944294
    42954295        /* Uninitialize ourselves here because currently there may be no
     
    43064306    }
    43074307
    4308     AssertReturn (autoCaller.state() == Ready, E_FAIL);
     4308    AssertReturn(autoCaller.state() == Ready, E_FAIL);
    43094309
    43104310    /* we will probably modify these and want to prevent concurrent
     
    43644364    {
    43654365        rc = saveSettings();
    4366         CheckComRCReturnRC (rc);
     4366        CheckComRCReturnRC(rc);
    43674367    }
    43684368
    43694369    /* Implicitly detach DVD/Floppy */
    43704370    rc = mDVDDrive->unmount();
    4371     if (SUCCEEDED (rc))
     4371    if (SUCCEEDED(rc))
    43724372        rc = mFloppyDrive->unmount();
    43734373
    4374     if (SUCCEEDED (rc))
     4374    if (SUCCEEDED(rc))
    43754375    {
    43764376        /* we may have had implicit modifications we want to fix on success */
     
    44114411                                     BOOL *aRegistered /* = NULL */)
    44124412{
    4413     AutoCaller autoCaller (this);
    4414     AssertComRCReturnRC (autoCaller.rc());
    4415 
    4416     AutoWriteLock alock (this);
    4417 
    4418     HRESULT rc = checkStateDependency (aDepType);
    4419     CheckComRCReturnRC (rc);
     4413    AutoCaller autoCaller(this);
     4414    AssertComRCReturnRC(autoCaller.rc());
     4415
     4416    AutoWriteLock alock(this);
     4417
     4418    HRESULT rc = checkStateDependency(aDepType);
     4419    CheckComRCReturnRC(rc);
    44204420
    44214421    {
     
    44544454void Machine::releaseStateDependency()
    44554455{
    4456     AutoCaller autoCaller (this);
     4456    AutoCaller autoCaller(this);
    44574457    AssertComRCReturnVoid (autoCaller.rc());
    44584458
    4459     AutoWriteLock alock (this);
     4459    AutoWriteLock alock(this);
    44604460
    44614461    AssertReturnVoid (mData->mMachineStateDeps != 0
     
    45054505 *        lock.
    45064506 */
    4507 HRESULT Machine::checkStateDependency (StateDependency aDepType)
     4507HRESULT Machine::checkStateDependency(StateDependency aDepType)
    45084508{
    45094509    switch (aDepType)
     
    45504550HRESULT Machine::initDataAndChildObjects()
    45514551{
    4552     AutoCaller autoCaller (this);
    4553     AssertComRCReturnRC (autoCaller.rc());
     4552    AutoCaller autoCaller(this);
     4553    AssertComRCReturnRC(autoCaller.rc());
    45544554    AssertComRCReturn (autoCaller.state() == InInit ||
    45554555                       autoCaller.state() == Limited, E_FAIL);
    45564556
    4557     AssertReturn (!mData->mAccessible, E_FAIL);
     4557    AssertReturn(!mData->mAccessible, E_FAIL);
    45584558
    45594559    /* allocate data structures */
     
    45684568
    45694569    /* create associated BIOS settings object */
    4570     unconst (mBIOSSettings).createObject();
     4570    unconst(mBIOSSettings).createObject();
    45714571    mBIOSSettings->init (this);
    45724572
    45734573#ifdef VBOX_WITH_VRDP
    45744574    /* create an associated VRDPServer object (default is disabled) */
    4575     unconst (mVRDPServer).createObject();
     4575    unconst(mVRDPServer).createObject();
    45764576    mVRDPServer->init (this);
    45774577#endif
    45784578
    45794579    /* create an associated DVD drive object */
    4580     unconst (mDVDDrive).createObject();
     4580    unconst(mDVDDrive).createObject();
    45814581    mDVDDrive->init (this);
    45824582
    45834583    /* create an associated floppy drive object */
    4584     unconst (mFloppyDrive).createObject();
     4584    unconst(mFloppyDrive).createObject();
    45854585    mFloppyDrive->init (this);
    45864586
     
    45884588    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    45894589    {
    4590         unconst (mSerialPorts [slot]).createObject();
     4590        unconst(mSerialPorts [slot]).createObject();
    45914591        mSerialPorts [slot]->init (this, slot);
    45924592    }
     
    45954595    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    45964596    {
    4597         unconst (mParallelPorts [slot]).createObject();
     4597        unconst(mParallelPorts [slot]).createObject();
    45984598        mParallelPorts [slot]->init (this, slot);
    45994599    }
    46004600
    46014601    /* create the audio adapter object (always present, default is disabled) */
    4602     unconst (mAudioAdapter).createObject();
     4602    unconst(mAudioAdapter).createObject();
    46034603    mAudioAdapter->init (this);
    46044604
    46054605    /* create the USB controller object (always present, default is disabled) */
    4606     unconst (mUSBController).createObject();
     4606    unconst(mUSBController).createObject();
    46074607    mUSBController->init (this);
    46084608
     
    46104610    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    46114611    {
    4612         unconst (mNetworkAdapters [slot]).createObject();
     4612        unconst(mNetworkAdapters [slot]).createObject();
    46134613        mNetworkAdapters [slot]->init (this, slot);
    46144614    }
     
    46284628void Machine::uninitDataAndChildObjects()
    46294629{
    4630     AutoCaller autoCaller (this);
     4630    AutoCaller autoCaller(this);
    46314631    AssertComRCReturnVoid (autoCaller.rc());
    46324632    AssertComRCReturnVoid (autoCaller.state() == InUninit ||
     
    46444644        {
    46454645            mNetworkAdapters [slot]->uninit();
    4646             unconst (mNetworkAdapters [slot]).setNull();
     4646            unconst(mNetworkAdapters [slot]).setNull();
    46474647        }
    46484648    }
     
    46514651    {
    46524652        mUSBController->uninit();
    4653         unconst (mUSBController).setNull();
     4653        unconst(mUSBController).setNull();
    46544654    }
    46554655
     
    46574657    {
    46584658        mAudioAdapter->uninit();
    4659         unconst (mAudioAdapter).setNull();
     4659        unconst(mAudioAdapter).setNull();
    46604660    }
    46614661
     
    46654665        {
    46664666            mParallelPorts [slot]->uninit();
    4667             unconst (mParallelPorts [slot]).setNull();
     4667            unconst(mParallelPorts [slot]).setNull();
    46684668        }
    46694669    }
     
    46744674        {
    46754675            mSerialPorts [slot]->uninit();
    4676             unconst (mSerialPorts [slot]).setNull();
     4676            unconst(mSerialPorts [slot]).setNull();
    46774677        }
    46784678    }
     
    46814681    {
    46824682        mFloppyDrive->uninit();
    4683         unconst (mFloppyDrive).setNull();
     4683        unconst(mFloppyDrive).setNull();
    46844684    }
    46854685
     
    46874687    {
    46884688        mDVDDrive->uninit();
    4689         unconst (mDVDDrive).setNull();
     4689        unconst(mDVDDrive).setNull();
    46904690    }
    46914691
     
    46944694    {
    46954695        mVRDPServer->uninit();
    4696         unconst (mVRDPServer).setNull();
     4696        unconst(mVRDPServer).setNull();
    46974697    }
    46984698#endif
     
    47014701    {
    47024702        mBIOSSettings->uninit();
    4703         unconst (mBIOSSettings).setNull();
     4703        unconst(mBIOSSettings).setNull();
    47044704    }
    47054705
     
    47584758    AssertReturnVoid (isWriteLockOnCurrentThread());
    47594759
    4760     AutoWriteLock alock (this);
     4760    AutoWriteLock alock(this);
    47614761
    47624762    /* Wait for all state dependants if necessary */
     
    47674767            RTSemEventMultiCreate (&mData->mMachineStateDepsSem);
    47684768
    4769         LogFlowThisFunc (("Waiting for state deps (%d) to drop to zero...\n",
     4769        LogFlowThisFunc(("Waiting for state deps (%d) to drop to zero...\n",
    47704770                          mData->mMachineStateDeps));
    47714771
     
    47974797{
    47984798    LogFlowThisFuncEnter();
    4799     LogFlowThisFunc (("aMachineState=%d\n", aMachineState));
    4800 
    4801     AutoCaller autoCaller (this);
     4799    LogFlowThisFunc(("aMachineState=%d\n", aMachineState));
     4800
     4801    AutoCaller autoCaller(this);
    48024802    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    48034803
    4804     AutoWriteLock alock (this);
     4804    AutoWriteLock alock(this);
    48054805
    48064806    /* wait for state dependants to drop to zero */
     
    48134813        RTTimeNow (&mData->mLastStateChange);
    48144814
    4815         mParent->onMachineStateChange (mData->mUuid, aMachineState);
     4815        mParent->onMachineStateChange(mData->mUuid, aMachineState);
    48164816    }
    48174817
     
    48354835 */
    48364836HRESULT Machine::findSharedFolder (CBSTR aName,
    4837                                    ComObjPtr <SharedFolder> &aSharedFolder,
     4837                                   ComObjPtr<SharedFolder> &aSharedFolder,
    48384838                                   bool aSetError /* = false */)
    48394839{
     
    48434843        ++ it)
    48444844    {
    4845         AutoWriteLock alock (*it);
     4845        AutoWriteLock alock(*it);
    48464846        found = (*it)->name() == aName;
    48474847        if (found)
     
    48714871{
    48724872    LogFlowThisFuncEnter();
    4873     AssertReturn (mType == IsMachine, E_FAIL);
    4874 
    4875     AutoCaller autoCaller (this);
    4876     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     4873    AssertReturn(mType == IsMachine, E_FAIL);
     4874
     4875    AutoCaller autoCaller(this);
     4876    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    48774877
    48784878    HRESULT rc = S_OK;
     
    49124912        }
    49134913        else
    4914             unconst (mData->mUuid) = id;
     4914            unconst(mData->mUuid) = id;
    49154915
    49164916        /* name (required) */
     
    49344934
    49354935            /* look up the object by Id to check it is valid */
    4936             ComPtr <IGuestOSType> guestOSType;
     4936            ComPtr<IGuestOSType> guestOSType;
    49374937            rc = mParent->GetGuestOSType (mUserData->mOSTypeId,
    49384938                                          guestOSType.asOutParam());
     
    49474947                Utf8Str stateFilePathFull = stateFilePath;
    49484948                int vrc = calculateFullPath (stateFilePathFull, stateFilePathFull);
    4949                 if (RT_FAILURE (vrc))
     4949                if (RT_FAILURE(vrc))
    49504950                {
    49514951                    throw setError (E_FAIL,
     
    50225022         *  otherwise it will be not possible to change the settings
    50235023         *  somewehere in the code above because all setters will be
    5024          *  blocked by checkStateDependency (MutableStateDep).
     5024         *  blocked by checkStateDependency(MutableStateDep).
    50255025         */
    50265026
     
    50675067    using namespace settings;
    50685068
    5069     AssertReturn (!aNode.isNull(), E_INVALIDARG);
    5070     AssertReturn (mType == IsMachine, E_FAIL);
     5069    AssertReturn(!aNode.isNull(), E_INVALIDARG);
     5070    AssertReturn(mType == IsMachine, E_FAIL);
    50715071
    50725072    /* create a snapshot machine object */
    5073     ComObjPtr <SnapshotMachine> snapshotMachine;
     5073    ComObjPtr<SnapshotMachine> snapshotMachine;
    50745074    snapshotMachine.createObject();
    50755075
     
    50865086            Utf8Str stateFilePathFull = stateFilePath;
    50875087            int vrc = calculateFullPath (stateFilePathFull, stateFilePathFull);
    5088             if (RT_FAILURE (vrc))
     5088            if (RT_FAILURE(vrc))
    50895089                return setError (E_FAIL,
    50905090                                 tr ("Invalid saved state file path '%ls' (%Rrc)"),
     
    51035103        rc = snapshotMachine->init (this, hardwareNode, storageNode,
    51045104                                    uuid, stateFilePath);
    5105         CheckComRCReturnRC (rc);
     5105        CheckComRCReturnRC(rc);
    51065106    }
    51075107
    51085108    /* create a snapshot object */
    5109     ComObjPtr <Snapshot> snapshot;
     5109    ComObjPtr<Snapshot> snapshot;
    51105110    snapshot.createObject();
    51115111
     
    51715171    using namespace settings;
    51725172
    5173     AssertReturn (!aNode.isNull(), E_INVALIDARG);
    5174     AssertReturn (mType == IsMachine || mType == IsSnapshotMachine, E_FAIL);
     5173    AssertReturn(!aNode.isNull(), E_INVALIDARG);
     5174    AssertReturn(mType == IsMachine || mType == IsSnapshotMachine, E_FAIL);
    51755175
    51765176    HRESULT rc = S_OK;
     
    52795279    /* RemoteDisplay */
    52805280    rc = mVRDPServer->loadSettings (aNode);
    5281     CheckComRCReturnRC (rc);
     5281    CheckComRCReturnRC(rc);
    52825282#endif
    52835283
    52845284    /* BIOS */
    52855285    rc = mBIOSSettings->loadSettings (aNode);
    5286     CheckComRCReturnRC (rc);
     5286    CheckComRCReturnRC(rc);
    52875287
    52885288    /* DVD drive */
    52895289    rc = mDVDDrive->loadSettings (aNode);
    5290     CheckComRCReturnRC (rc);
     5290    CheckComRCReturnRC(rc);
    52915291
    52925292    /* Floppy drive */
    52935293    rc = mFloppyDrive->loadSettings (aNode);
    5294     CheckComRCReturnRC (rc);
     5294    CheckComRCReturnRC(rc);
    52955295
    52965296    /* USB Controller */
    52975297    rc = mUSBController->loadSettings (aNode);
    5298     CheckComRCReturnRC (rc);
     5298    CheckComRCReturnRC(rc);
    52995299
    53005300    /* Network node (required) */
     
    53175317
    53185318            rc = mNetworkAdapters [slot]->loadSettings (*it);
    5319             CheckComRCReturnRC (rc);
     5319            CheckComRCReturnRC(rc);
    53205320        }
    53215321    }
     
    53375337
    53385338            rc = mSerialPorts [slot]->loadSettings (*it);
    5339             CheckComRCReturnRC (rc);
     5339            CheckComRCReturnRC(rc);
    53405340        }
    53415341    }
     
    53575357
    53585358            rc = mParallelPorts [slot]->loadSettings (*it);
    5359             CheckComRCReturnRC (rc);
     5359            CheckComRCReturnRC(rc);
    53605360        }
    53615361    }
     
    53635363    /* AudioAdapter */
    53645364    rc = mAudioAdapter->loadSettings (aNode);
    5365     CheckComRCReturnRC (rc);
     5365    CheckComRCReturnRC(rc);
    53665366
    53675367    /* Shared folders (required) */
     
    53835383
    53845384            rc = CreateSharedFolder (name, hostPath, writable);
    5385             CheckComRCReturnRC (rc);
     5385            CheckComRCReturnRC(rc);
    53865386        }
    53875387    }
     
    54775477    using namespace settings;
    54785478
    5479     AssertReturn (!aNode.isNull(), E_INVALIDARG);
    5480     AssertReturn (mType == IsMachine || mType == IsSnapshotMachine, E_FAIL);
     5479    AssertReturn(!aNode.isNull(), E_INVALIDARG);
     5480    AssertReturn(mType == IsMachine || mType == IsSnapshotMachine, E_FAIL);
    54815481
    54825482    HRESULT rc = S_OK;
     
    55345534        /* Try to find one with the name first. */
    55355535        rc = getStorageControllerByName (controllerName, ctl, false /* aSetError */);
    5536         if (SUCCEEDED (rc))
     5536        if (SUCCEEDED(rc))
    55375537            return setError (VBOX_E_OBJECT_IN_USE,
    55385538                tr ("Storage controller named '%ls' already exists"), controllerName.raw());
     
    55405540        ctl.createObject();
    55415541        rc = ctl->init (this, controllerName, connection);
    5542         CheckComRCReturnRC (rc);
     5542        CheckComRCReturnRC(rc);
    55435543
    55445544        mStorageControllers->push_back (ctl);
     
    55945594    using namespace settings;
    55955595
    5596     AssertReturn (!aNode.isNull(), E_INVALIDARG);
    5597     AssertReturn ((mType == IsMachine && aSnapshotId == NULL) ||
     5596    AssertReturn(!aNode.isNull(), E_INVALIDARG);
     5597    AssertReturn((mType == IsMachine && aSnapshotId == NULL) ||
    55985598                  (mType == IsSnapshotMachine && aSnapshotId != NULL), E_FAIL);
    55995599
     
    56385638        ComObjPtr<HardDisk> hd;
    56395639        rc = mParent->findHardDisk(&uuid, NULL, true /* aDoSetError */, &hd);
    5640         CheckComRCReturnRC (rc);
     5640        CheckComRCReturnRC(rc);
    56415641
    56425642        AutoWriteLock hdLock (hd);
     
    57265726    using namespace settings;
    57275727
    5728     AssertReturn (aSnapshot && !aMachineNode.isNull()
     5728    AssertReturn(aSnapshot && !aMachineNode.isNull()
    57295729                  && aSnapshotNode != NULL, E_FAIL);
    57305730
     
    57585758        }
    57595759
    5760         AssertReturn (!snapshotsNode.isNull(), E_FAIL);
     5760        AssertReturn(!snapshotsNode.isNull(), E_FAIL);
    57615761
    57625762        Key::List children = snapshotsNode.keys ("Snapshot");
     
    57825782
    57835783    // we must always succesfully find the node
    5784     AssertReturn (!snapshotNode.isNull(), E_FAIL);
    5785     AssertReturn (!snapshotsNode.isNull(), E_FAIL);
     5784    AssertReturn(!snapshotNode.isNull(), E_FAIL);
     5785    AssertReturn(!snapshotsNode.isNull(), E_FAIL);
    57865786
    57875787    if (aSnapshotsNode && (snapshotsNode != aMachineNode))
     
    58415841                              bool aSetError /* = false */)
    58425842{
    5843     AssertReturn (aName, E_INVALIDARG);
     5843    AssertReturn(aName, E_INVALIDARG);
    58445844
    58455845    AutoReadLock chlock(snapshotsTreeLockHandle());
     
    58745874 */
    58755875HRESULT Machine::getStorageControllerByName(CBSTR aName,
    5876                                             ComObjPtr <StorageController> &aStorageController,
     5876                                            ComObjPtr<StorageController> &aStorageController,
    58775877                                            bool aSetError /* = false */)
    58785878{
    5879     AssertReturn (aName, E_INVALIDARG);
     5879    AssertReturn(aName, E_INVALIDARG);
    58805880
    58815881    for (StorageControllerList::const_iterator it =
     
    59005900                                                    HDData::AttachmentList &atts)
    59015901{
    5902     AutoCaller autoCaller (this);
     5902    AutoCaller autoCaller(this);
    59035903    CheckComRCReturnRC(autoCaller.rc());
    59045904
     
    59335933     * currently differentiate it in callers of saveSettings() so we don't
    59345934     * make difference here too.  */
    5935     AssertReturn (mParent->isWriteLockOnCurrentThread(), E_FAIL);
    5936     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     5935    AssertReturn(mParent->isWriteLockOnCurrentThread(), E_FAIL);
     5936    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    59375937
    59385938    HRESULT rc = S_OK;
     
    59555955            /* unlock the old config file */
    59565956            rc = unlockConfig();
    5957             CheckComRCReturnRC (rc);
     5957            CheckComRCReturnRC(rc);
    59585958        }
    59595959
     
    59895989                    /* perform real rename only if the machine is not new */
    59905990                    vrc = RTPathRename (configDir.raw(), newConfigDir.raw(), 0);
    5991                     if (RT_FAILURE (vrc))
     5991                    if (RT_FAILURE(vrc))
    59925992                    {
    59935993                        rc = setError (E_FAIL,
     
    60156015                    /* perform real rename only if the machine is not new */
    60166016                    vrc = RTFileRename (configFile.raw(), newConfigFile.raw(), 0);
    6017                     if (RT_FAILURE (vrc))
     6017                    if (RT_FAILURE(vrc))
    60186018                    {
    60196019                        rc = setError (E_FAIL,
     
    60916091            /* lock the config again */
    60926092            HRESULT rc2 = lockConfig();
    6093             if (SUCCEEDED (rc))
     6093            if (SUCCEEDED(rc))
    60946094                rc = rc2;
    60956095        }
    60966096
    6097         CheckComRCReturnRC (rc);
     6097        CheckComRCReturnRC(rc);
    60986098    }
    60996099
     
    61236123                          RTFILE_O_READWRITE | RTFILE_O_CREATE |
    61246124                          RTFILE_O_DENY_WRITE);
    6125         if (RT_SUCCESS (vrc))
     6125        if (RT_SUCCESS(vrc))
    61266126        {
    61276127            vrc = RTFileWrite (mData->mHandleCfgFile,
     
    61296129                               strlen (gDefaultMachineConfig), NULL);
    61306130        }
    6131         if (RT_FAILURE (vrc))
     6131        if (RT_FAILURE(vrc))
    61326132        {
    61336133            mData->mHandleCfgFile = NIL_RTFILE;
     
    61696169     * currently differentiate it in callers of saveSettings() so we don't
    61706170     * make difference here too.  */
    6171     AssertReturn (mParent->isWriteLockOnCurrentThread(), E_FAIL);
    6172     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     6171    AssertReturn(mParent->isWriteLockOnCurrentThread(), E_FAIL);
     6172    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    61736173
    61746174    /* make sure child objects are unable to modify the settings while we are
     
    61766176    ensureNoStateDependencies();
    61776177
    6178     AssertReturn (mType == IsMachine || mType == IsSessionMachine, E_FAIL);
     6178    AssertReturn(mType == IsMachine || mType == IsSessionMachine, E_FAIL);
    61796179
    61806180    BOOL currentStateModified = mData->mCurrentStateModified;
     
    62056205    bool isNew = false;
    62066206    rc = prepareSaveSettings (isRenamed, isNew);
    6207     CheckComRCReturnRC (rc);
     6207    CheckComRCReturnRC(rc);
    62086208
    62096209    try
     
    63626362    }
    63636363
    6364     if (SUCCEEDED (rc))
     6364    if (SUCCEEDED(rc))
    63656365    {
    63666366        commit();
     
    63786378         * inform callbacks. */
    63796379        if (mType == IsSessionMachine)
    6380             mParent->onMachineDataChange (mData->mUuid);
    6381     }
    6382 
    6383     LogFlowThisFunc (("rc=%08X\n", rc));
     6380            mParent->onMachineDataChange(mData->mUuid);
     6381    }
     6382
     6383    LogFlowThisFunc(("rc=%08X\n", rc));
    63846384    LogFlowThisFuncLeave();
    63856385    return rc;
     
    64006400HRESULT Machine::saveSnapshotSettings (Snapshot *aSnapshot, int aOpFlags)
    64016401{
    6402     AutoCaller autoCaller (this);
     6402    AutoCaller autoCaller(this);
    64036403    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    64046404
    6405     AssertReturn (mType == IsMachine || mType == IsSessionMachine, E_FAIL);
     6405    AssertReturn(mType == IsMachine || mType == IsSessionMachine, E_FAIL);
    64066406
    64076407    /* This object's write lock is also necessary to serialize file access
    64086408     * (prevent concurrent reads and writes) */
    6409     AutoWriteLock alock (this);
    6410 
    6411     AssertReturn (isConfigLocked(), E_FAIL);
     6409    AutoWriteLock alock(this);
     6410
     6411    AssertReturn(isConfigLocked(), E_FAIL);
    64126412
    64136413    HRESULT rc = S_OK;
     
    64236423
    64246424        rc = VirtualBox::loadSettingsTree_ForUpdate (tree, file);
    6425         CheckComRCReturnRC (rc);
     6425        CheckComRCReturnRC(rc);
    64266426
    64276427        Key machineNode = tree.rootKey().key ("Machine");
    64286428
    64296429        rc = saveSnapshotSettingsWorker (machineNode, aSnapshot, aOpFlags);
    6430         CheckComRCReturnRC (rc);
     6430        CheckComRCReturnRC(rc);
    64316431
    64326432        /* save settings on success */
    64336433        rc = VirtualBox::saveSettingsTree (tree, file,
    64346434                                           mData->mSettingsFileVersion);
    6435         CheckComRCReturnRC (rc);
     6435        CheckComRCReturnRC(rc);
    64366436    }
    64376437    catch (...)
     
    64696469    using namespace settings;
    64706470
    6471     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    6472 
    6473     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     6471    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     6472
     6473    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    64746474
    64756475    int op = aOpFlags & SaveSS_OpMask;
    6476     AssertReturn (
     6476    AssertReturn(
    64776477        (aSnapshot && (op == SaveSS_AddOp || op == SaveSS_UpdateAttrsOp ||
    64786478                       op == SaveSS_UpdateAllOp)) ||
     
    65116511
    65126512        Assert (!!aSnapshot);
    6513         ComObjPtr <Snapshot> parent = aSnapshot->parent();
     6513        ComObjPtr<Snapshot> parent = aSnapshot->parent();
    65146514
    65156515        if (op == SaveSS_AddOp)
     
    65586558                         * we need to inform callbacks manually. */
    65596559                        if (mType == IsSessionMachine)
    6560                             mParent->onMachineDataChange (mData->mUuid);
     6560                            mParent->onMachineDataChange(mData->mUuid);
    65616561                    }
    65626562                }
     
    65986598    while (0);
    65996599
    6600     if (SUCCEEDED (rc))
     6600    if (SUCCEEDED(rc))
    66016601    {
    66026602        /* update currentSnapshot when appropriate */
     
    66306630    using namespace settings;
    66316631
    6632     AssertReturn (!aNode.isNull(), E_INVALIDARG);
     6632    AssertReturn(!aNode.isNull(), E_INVALIDARG);
    66336633
    66346634    HRESULT rc = S_OK;
     
    67316731    /* VRDP settings (optional) */
    67326732    rc = mVRDPServer->saveSettings (aNode);
    6733     CheckComRCReturnRC (rc);
     6733    CheckComRCReturnRC(rc);
    67346734#endif
    67356735
    67366736    /* BIOS (required) */
    67376737    rc = mBIOSSettings->saveSettings (aNode);
    6738     CheckComRCReturnRC (rc);
     6738    CheckComRCReturnRC(rc);
    67396739
    67406740    /* DVD drive (required) */
    67416741    rc = mDVDDrive->saveSettings (aNode);
    6742     CheckComRCReturnRC (rc);
     6742    CheckComRCReturnRC(rc);
    67436743
    67446744    /* Flooppy drive (required) */
    67456745    rc = mFloppyDrive->saveSettings (aNode);
    6746     CheckComRCReturnRC (rc);
     6746    CheckComRCReturnRC(rc);
    67476747
    67486748    /* USB Controller (required) */
    67496749    rc = mUSBController->saveSettings (aNode);
    6750     CheckComRCReturnRC (rc);
     6750    CheckComRCReturnRC(rc);
    67516751
    67526752    /* Network adapters (required) */
     
    67616761
    67626762            rc = mNetworkAdapters [slot]->saveSettings (adapterNode);
    6763             CheckComRCReturnRC (rc);
     6763            CheckComRCReturnRC(rc);
    67646764        }
    67656765    }
     
    67766776
    67776777            rc = mSerialPorts [slot]->saveSettings (portNode);
    6778             CheckComRCReturnRC (rc);
     6778            CheckComRCReturnRC(rc);
    67796779        }
    67806780    }
     
    67916791
    67926792            rc = mParallelPorts [slot]->saveSettings (portNode);
    6793             CheckComRCReturnRC (rc);
     6793            CheckComRCReturnRC(rc);
    67946794        }
    67956795    }
     
    67976797    /* Audio adapter */
    67986798    rc = mAudioAdapter->saveSettings (aNode);
    6799     CheckComRCReturnRC (rc);
     6799    CheckComRCReturnRC(rc);
    68006800
    68016801    /* Shared folders */
     
    68076807             ++ it)
    68086808        {
    6809             ComObjPtr <SharedFolder> folder = *it;
     6809            ComObjPtr<SharedFolder> folder = *it;
    68106810
    68116811            Key folderNode = sharedFoldersNode.appendKey ("SharedFolder");
     
    69066906    using namespace settings;
    69076907
    6908     AssertReturn (!aNode.isNull(), E_INVALIDARG);
     6908    AssertReturn(!aNode.isNull(), E_INVALIDARG);
    69096909
    69106910    for (StorageControllerList::const_iterator
     
    69156915        HRESULT rc;
    69166916        const char *type = NULL;
    6917         ComObjPtr <StorageController> ctl = *it;
     6917        ComObjPtr<StorageController> ctl = *it;
    69186918
    69196919        Key ctlNode = aNode.appendKey ("StorageController");
     
    69826982    using namespace settings;
    69836983
    6984     AssertReturn (!aNode.isNull(), E_INVALIDARG);
     6984    AssertReturn(!aNode.isNull(), E_INVALIDARG);
    69856985
    69866986    HDData::AttachmentList atts;
     
    70257025        return S_OK;
    70267026
    7027     AutoCaller autoCaller (this);
     7027    AutoCaller autoCaller(this);
    70287028    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    70297029
    70307030    /* This object's write lock is also necessary to serialize file access
    70317031     * (prevent concurrent reads and writes) */
    7032     AutoWriteLock alock (this);
    7033 
    7034     AssertReturn (isConfigLocked(), E_FAIL);
     7032    AutoWriteLock alock(this);
     7033
     7034    AssertReturn(isConfigLocked(), E_FAIL);
    70357035
    70367036    HRESULT rc = S_OK;
     
    70467046
    70477047        rc = VirtualBox::loadSettingsTree_ForUpdate (tree, file);
    7048         CheckComRCReturnRC (rc);
     7048        CheckComRCReturnRC(rc);
    70497049
    70507050        Key machineNode = tree.rootKey().key ("Machine");
     
    70877087        rc = VirtualBox::saveSettingsTree (tree, file,
    70887088                                           mData->mSettingsFileVersion);
    7089         CheckComRCReturnRC (rc);
     7089        CheckComRCReturnRC(rc);
    70907090    }
    70917091    catch (...)
     
    71297129 */
    71307130HRESULT Machine::createImplicitDiffs (const Bstr &aFolder,
    7131                                       ComObjPtr <Progress> &aProgress,
     7131                                      ComObjPtr<Progress> &aProgress,
    71327132                                      bool aOnline)
    71337133{
    7134     AssertReturn (!aFolder.isEmpty(), E_FAIL);
    7135 
    7136     AutoCaller autoCaller (this);
     7134    AssertReturn(!aFolder.isEmpty(), E_FAIL);
     7135
     7136    AutoCaller autoCaller(this);
    71377137    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    71387138
    7139     AutoWriteLock alock (this);
     7139    AutoWriteLock alock(this);
    71407140
    71417141    /* must be in a protective state because we leave the lock below */
    7142     AssertReturn (mData->mMachineState == MachineState_Saving ||
     7142    AssertReturn(mData->mMachineState == MachineState_Saving ||
    71437143                  mData->mMachineState == MachineState_Discarding, E_FAIL);
    71447144
     
    72747274HRESULT Machine::deleteImplicitDiffs()
    72757275{
    7276     AutoCaller autoCaller (this);
     7276    AutoCaller autoCaller(this);
    72777277    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    72787278
    7279     AutoWriteLock alock (this);
    7280 
    7281     AssertReturn (mHDData.isBackedUp(), E_FAIL);
     7279    AutoWriteLock alock(this);
     7280
     7281    AssertReturn(mHDData.isBackedUp(), E_FAIL);
    72827282
    72837283    HRESULT rc = S_OK;
     
    73797379void Machine::fixupHardDisks(bool aCommit, bool aOnline /*= false*/)
    73807380{
    7381     AutoCaller autoCaller (this);
     7381    AutoCaller autoCaller(this);
    73827382    AssertComRCReturnVoid (autoCaller.rc());
    73837383
    7384     AutoWriteLock alock (this);
     7384    AutoWriteLock alock(this);
    73857385
    73867386    /* no attach/detach operations -- nothing to do */
     
    74147414                    mData->mSession.mLockedMedia.push_back (
    74157415                        Data::Session::LockedMedia::value_type (
    7416                             ComPtr <IHardDisk> (hd), true));
     7416                            ComPtr<IHardDisk> (hd), true));
    74177417
    74187418                    /* also, relock the old hard disk which is a base for the
     
    74337433                    mData->mSession.mLockedMedia.push_back (
    74347434                        Data::Session::LockedMedia::value_type (
    7435                             ComPtr <IHardDisk> (parent), false));
     7435                            ComPtr<IHardDisk> (parent), false));
    74367436                }
    74377437
     
    74677467                rc = hd->UnlockWrite (&state);
    74687468                /* the disk may be alredy relocked for reading above */
    7469                 Assert (SUCCEEDED (rc) || state == MediaState_LockedRead);
     7469                Assert (SUCCEEDED(rc) || state == MediaState_LockedRead);
    74707470            }
    74717471        }
     
    75067506                              RTFILE_O_READWRITE | RTFILE_O_OPEN |
    75077507                              RTFILE_O_DENY_WRITE);
    7508         if (RT_FAILURE (vrc) && (vrc != VERR_FILE_NOT_FOUND))
     7508        if (RT_FAILURE(vrc) && (vrc != VERR_FILE_NOT_FOUND))
    75097509        {
    75107510            /* Open the associated config file only with read access. */
     
    75137513                              RTFILE_O_READ | RTFILE_O_OPEN |
    75147514                              RTFILE_O_DENY_NONE);
    7515             if (RT_FAILURE (vrc))
     7515            if (RT_FAILURE(vrc))
    75167516            {
    75177517                /* We even cannot open it in read mode, so there's seriously
     
    75387538    }
    75397539
    7540     LogFlowThisFunc (("mConfigFile={%ls}, mHandleCfgFile=%d, rc=%08X\n",
     7540    LogFlowThisFunc(("mConfigFile={%ls}, mHandleCfgFile=%d, rc=%08X\n",
    75417541                      mData->mConfigFileFull.raw(), mData->mHandleCfgFile, rc));
    75427542    return rc;
     
    75647564    }
    75657565
    7566     LogFlowThisFunc (("\n"));
     7566    LogFlowThisFunc(("\n"));
    75677567
    75687568    return rc;
     
    75867586    char *dirName = RTPathFilename(settingsDir);
    75877587
    7588     AssertReturn (dirName, false);
     7588    AssertReturn(dirName, false);
    75897589
    75907590    /* if we don't rename anything on name change, return false shorlty */
     
    76037603bool Machine::isModified()
    76047604{
    7605     AutoCaller autoCaller (this);
     7605    AutoCaller autoCaller(this);
    76067606    AssertComRCReturn (autoCaller.rc(), false);
    76077607
    7608     AutoReadLock alock (this);
     7608    AutoReadLock alock(this);
    76097609
    76107610    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
     
    76577657bool Machine::isReallyModified (bool aIgnoreUserData /* = false */)
    76587658{
    7659     AutoCaller autoCaller (this);
     7659    AutoCaller autoCaller(this);
    76607660    AssertComRCReturn (autoCaller.rc(), false);
    76617661
    7662     AutoReadLock alock (this);
     7662    AutoReadLock alock(this);
    76637663
    76647664    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
     
    77167716void Machine::rollback (bool aNotify)
    77177717{
    7718     AutoCaller autoCaller (this);
     7718    AutoCaller autoCaller(this);
    77197719    AssertComRCReturn (autoCaller.rc(), (void) 0);
    77207720
    7721     AutoWriteLock alock (this);
     7721    AutoWriteLock alock(this);
    77227722
    77237723    /* check for changes in own data */
     
    77977797         usbChanged = false;
    77987798
    7799     ComPtr <INetworkAdapter> networkAdapters [RT_ELEMENTS (mNetworkAdapters)];
    7800     ComPtr <ISerialPort> serialPorts [RT_ELEMENTS (mSerialPorts)];
    7801     ComPtr <IParallelPort> parallelPorts [RT_ELEMENTS (mParallelPorts)];
     7799    ComPtr<INetworkAdapter> networkAdapters [RT_ELEMENTS (mNetworkAdapters)];
     7800    ComPtr<ISerialPort> serialPorts [RT_ELEMENTS (mSerialPorts)];
     7801    ComPtr<IParallelPort> parallelPorts [RT_ELEMENTS (mParallelPorts)];
    78027802
    78037803    if (mBIOSSettings)
     
    78407840        /* inform the direct session about changes */
    78417841
    7842         ComObjPtr <Machine> that = this;
     7842        ComObjPtr<Machine> that = this;
    78437843        alock.leave();
    78447844
     
    78797879void Machine::commit()
    78807880{
    7881     AutoCaller autoCaller (this);
     7881    AutoCaller autoCaller(this);
    78827882    AssertComRCReturnVoid (autoCaller.rc());
    78837883
     
    80258025         ++ it)
    80268026    {
    8027         ComObjPtr <SharedFolder> folder;
     8027        ComObjPtr<SharedFolder> folder;
    80288028        folder.createObject();
    80298029        HRESULT rc = folder->initCopy (machine(), *it);
     
    80488048         ++ it)
    80498049    {
    8050         ComObjPtr <StorageController> ctrl;
     8050        ComObjPtr<StorageController> ctrl;
    80518051        ctrl.createObject();
    80528052        ctrl->initCopy (this, *it);
     
    81338133    virtual void handler() = 0;
    81348134
    8135     ComObjPtr <SessionMachine> machine;
    8136     ComObjPtr <Progress> progress;
     8135    ComObjPtr<SessionMachine> machine;
     8136    ComObjPtr<Progress> progress;
    81378137    const MachineState_T state;
    81388138
     
    81628162    void handler() { machine->discardSnapshotHandler (*this); }
    81638163
    8164     ComObjPtr <Snapshot> snapshot;
     8164    ComObjPtr<Snapshot> snapshot;
    81658165};
    81668166
     
    81838183HRESULT SessionMachine::FinalConstruct()
    81848184{
    8185     LogFlowThisFunc (("\n"));
     8185    LogFlowThisFunc(("\n"));
    81868186
    81878187    /* set the proper type to indicate we're the SessionMachine instance */
    8188     unconst (mType) = IsSessionMachine;
     8188    unconst(mType) = IsSessionMachine;
    81898189
    81908190#if defined(RT_OS_WINDOWS)
     
    82038203void SessionMachine::FinalRelease()
    82048204{
    8205     LogFlowThisFunc (("\n"));
     8205    LogFlowThisFunc(("\n"));
    82068206
    82078207    uninit (Uninit::Unexpected);
     
    82148214{
    82158215    LogFlowThisFuncEnter();
    8216     LogFlowThisFunc (("mName={%ls}\n", aMachine->mUserData->mName.raw()));
    8217 
    8218     AssertReturn (aMachine, E_INVALIDARG);
    8219 
    8220     AssertReturn (aMachine->lockHandle()->isWriteLockOnCurrentThread(), E_FAIL);
     8216    LogFlowThisFunc(("mName={%ls}\n", aMachine->mUserData->mName.raw()));
     8217
     8218    AssertReturn(aMachine, E_INVALIDARG);
     8219
     8220    AssertReturn(aMachine->lockHandle()->isWriteLockOnCurrentThread(), E_FAIL);
    82218221
    82228222    /* Enclose the state transition NotReady->InInit->Ready */
    8223     AutoInitSpan autoInitSpan (this);
    8224     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     8223    AutoInitSpan autoInitSpan(this);
     8224    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    82258225
    82268226    /* create the interprocess semaphore */
     
    82978297
    82988298    /* memorize the peer Machine */
    8299     unconst (mPeer) = aMachine;
     8299    unconst(mPeer) = aMachine;
    83008300    /* share the parent pointer */
    8301     unconst (mParent) = aMachine->mParent;
     8301    unconst(mParent) = aMachine->mParent;
    83028302
    83038303    /* take the pointers to data to share */
     
    83138313    while (it != aMachine->mStorageControllers->end())
    83148314    {
    8315         ComObjPtr <StorageController> ctl;
     8315        ComObjPtr<StorageController> ctl;
    83168316        ctl.createObject();
    83178317        ctl->init(this, *it);
     
    83208320    }
    83218321
    8322     unconst (mBIOSSettings).createObject();
     8322    unconst(mBIOSSettings).createObject();
    83238323    mBIOSSettings->init (this, aMachine->mBIOSSettings);
    83248324#ifdef VBOX_WITH_VRDP
    83258325    /* create another VRDPServer object that will be mutable */
    8326     unconst (mVRDPServer).createObject();
     8326    unconst(mVRDPServer).createObject();
    83278327    mVRDPServer->init (this, aMachine->mVRDPServer);
    83288328#endif
    83298329    /* create another DVD drive object that will be mutable */
    8330     unconst (mDVDDrive).createObject();
     8330    unconst(mDVDDrive).createObject();
    83318331    mDVDDrive->init (this, aMachine->mDVDDrive);
    83328332    /* create another floppy drive object that will be mutable */
    8333     unconst (mFloppyDrive).createObject();
     8333    unconst(mFloppyDrive).createObject();
    83348334    mFloppyDrive->init (this, aMachine->mFloppyDrive);
    83358335    /* create another audio adapter object that will be mutable */
    8336     unconst (mAudioAdapter).createObject();
     8336    unconst(mAudioAdapter).createObject();
    83378337    mAudioAdapter->init (this, aMachine->mAudioAdapter);
    83388338    /* create a list of serial ports that will be mutable */
    83398339    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    83408340    {
    8341         unconst (mSerialPorts [slot]).createObject();
     8341        unconst(mSerialPorts [slot]).createObject();
    83428342        mSerialPorts [slot]->init (this, aMachine->mSerialPorts [slot]);
    83438343    }
     
    83458345    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    83468346    {
    8347         unconst (mParallelPorts [slot]).createObject();
     8347        unconst(mParallelPorts [slot]).createObject();
    83488348        mParallelPorts [slot]->init (this, aMachine->mParallelPorts [slot]);
    83498349    }
    83508350    /* create another USB controller object that will be mutable */
    8351     unconst (mUSBController).createObject();
     8351    unconst(mUSBController).createObject();
    83528352    mUSBController->init (this, aMachine->mUSBController);
    83538353
     
    83558355    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    83568356    {
    8357         unconst (mNetworkAdapters [slot]).createObject();
     8357        unconst(mNetworkAdapters [slot]).createObject();
    83588358        mNetworkAdapters [slot]->init (this, aMachine->mNetworkAdapters [slot]);
    83598359    }
     
    83808380{
    83818381    LogFlowThisFuncEnter();
    8382     LogFlowThisFunc (("reason=%d\n", aReason));
     8382    LogFlowThisFunc(("reason=%d\n", aReason));
    83838383
    83848384    /*
     
    83898389     *  This self reference will be released as the very last step on return.
    83908390     */
    8391     ComObjPtr <SessionMachine> selfRef = this;
     8391    ComObjPtr<SessionMachine> selfRef = this;
    83928392
    83938393    /* Enclose the state transition Ready->InUninit->NotReady */
    8394     AutoUninitSpan autoUninitSpan (this);
     8394    AutoUninitSpan autoUninitSpan(this);
    83958395    if (autoUninitSpan.uninitDone())
    83968396    {
    8397         LogFlowThisFunc (("Already uninitialized\n"));
     8397        LogFlowThisFunc(("Already uninitialized\n"));
    83988398        LogFlowThisFuncLeave();
    83998399        return;
     
    84068406         * below, the following is enough.
    84078407         */
    8408         LogFlowThisFunc (("Initialization failed.\n"));
     8408        LogFlowThisFunc(("Initialization failed.\n"));
    84098409#if defined(RT_OS_WINDOWS)
    84108410        if (mIPCSem)
     
    84278427        uninitDataAndChildObjects();
    84288428        mData.free();
    8429         unconst (mParent).setNull();
    8430         unconst (mPeer).setNull();
     8429        unconst(mParent).setNull();
     8430        unconst(mPeer).setNull();
    84318431        LogFlowThisFuncLeave();
    84328432        return;
     
    84478447    if (aReason == Uninit::Abnormal)
    84488448    {
    8449         LogWarningThisFunc (("ABNORMAL client termination! (wasBusy=%d)\n",
     8449        LogWarningThisFunc(("ABNORMAL client termination! (wasBusy=%d)\n",
    84508450                             Global::IsOnlineOrTransient (lastState)));
    84518451
     
    84578457    if (isModified())
    84588458    {
    8459         LogWarningThisFunc (("Discarding unsaved settings changes!\n"));
     8459        LogWarningThisFunc(("Discarding unsaved settings changes!\n"));
    84608460        rollback (false /* aNotify */);
    84618461    }
     
    84648464    if (mSnapshotData.mStateFilePath)
    84658465    {
    8466         LogWarningThisFunc (("canceling failed save state request!\n"));
     8466        LogWarningThisFunc(("canceling failed save state request!\n"));
    84678467        endSavingState (FALSE /* aSuccess  */);
    84688468    }
    84698469    else if (!mSnapshotData.mSnapshot.isNull())
    84708470    {
    8471         LogWarningThisFunc (("canceling untaken snapshot!\n"));
     8471        LogWarningThisFunc(("canceling untaken snapshot!\n"));
    84728472        endTakingSnapshot (FALSE /* aSuccess  */);
    84738473    }
     
    85188518    if (mData->mSession.mRemoteControls.size())
    85198519    {
    8520         LogFlowThisFunc (("Closing remote sessions (%d):\n",
     8520        LogFlowThisFunc(("Closing remote sessions (%d):\n",
    85218521                          mData->mSession.mRemoteControls.size()));
    85228522
     
    85258525        while (it != mData->mSession.mRemoteControls.end())
    85268526        {
    8527             LogFlowThisFunc (("  Calling remoteControl->Uninitialize()...\n"));
     8527            LogFlowThisFunc(("  Calling remoteControl->Uninitialize()...\n"));
    85288528            HRESULT rc = (*it)->Uninitialize();
    8529             LogFlowThisFunc (("  remoteControl->Uninitialize() returned %08X\n", rc));
     8529            LogFlowThisFunc(("  remoteControl->Uninitialize() returned %08X\n", rc));
    85308530            if (FAILED (rc))
    8531                 LogWarningThisFunc (("Forgot to close the remote session?\n"));
     8531                LogWarningThisFunc(("Forgot to close the remote session?\n"));
    85328532            ++ it;
    85338533        }
     
    85488548
    85498549    if ((aReason == Uninit::Unexpected))
    8550         LogWarningThisFunc (("Unexpected SessionMachine uninitialization!\n"));
     8550        LogWarningThisFunc(("Unexpected SessionMachine uninitialization!\n"));
    85518551
    85528552    if (aReason != Uninit::Normal)
     
    86058605    alock.leave();
    86068606
    8607     unconst (mParent).setNull();
    8608     unconst (mPeer).setNull();
     8607    unconst(mParent).setNull();
     8608    unconst(mPeer).setNull();
    86098609
    86108610    LogFlowThisFuncLeave();
     
    86208620RWLockHandle *SessionMachine::lockHandle() const
    86218621{
    8622     AssertReturn (!mPeer.isNull(), NULL);
     8622    AssertReturn(!mPeer.isNull(), NULL);
    86238623    return mPeer->lockHandle();
    86248624}
     
    86328632STDMETHODIMP SessionMachine::SetRemoveSavedState(BOOL aRemove)
    86338633{
    8634     AutoCaller autoCaller (this);
     8634    AutoCaller autoCaller(this);
    86358635    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    86368636
    8637     AutoWriteLock alock (this);
     8637    AutoWriteLock alock(this);
    86388638
    86398639    mRemoveSavedState = aRemove;
     
    86558655STDMETHODIMP SessionMachine::GetIPCId (BSTR *aId)
    86568656{
    8657     AutoCaller autoCaller (this);
     8657    AutoCaller autoCaller(this);
    86588658    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    86598659
    8660     AutoReadLock alock (this);
     8660    AutoReadLock alock(this);
    86618661
    86628662#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    8663     mIPCSemName.cloneTo (aId);
     8663    mIPCSemName.cloneTo(aId);
    86648664    return S_OK;
    86658665#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    86668666# ifdef VBOX_WITH_NEW_SYS_V_KEYGEN
    8667     mIPCKey.cloneTo (aId);
     8667    mIPCKey.cloneTo(aId);
    86688668# else /* !VBOX_WITH_NEW_SYS_V_KEYGEN */
    8669     mData->mConfigFileFull.cloneTo (aId);
     8669    mData->mConfigFileFull.cloneTo(aId);
    86708670# endif /* !VBOX_WITH_NEW_SYS_V_KEYGEN */
    86718671    return S_OK;
     
    86858685                                                  ULONG *aMaskedIfs)
    86868686{
    8687     LogFlowThisFunc (("\n"));
     8687    LogFlowThisFunc(("\n"));
    86888688
    86898689    CheckComArgNotNull (aUSBDevice);
    8690     CheckComArgOutPointerValid (aMatched);
    8691 
    8692     AutoCaller autoCaller (this);
     8690    CheckComArgOutPointerValid(aMatched);
     8691
     8692    AutoCaller autoCaller(this);
    86938693    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    86948694
     
    87098709STDMETHODIMP SessionMachine::CaptureUSBDevice (IN_BSTR aId)
    87108710{
    8711     LogFlowThisFunc (("\n"));
    8712 
    8713     AutoCaller autoCaller (this);
    8714     AssertComRCReturnRC (autoCaller.rc());
     8711    LogFlowThisFunc(("\n"));
     8712
     8713    AutoCaller autoCaller(this);
     8714    AssertComRCReturnRC(autoCaller.rc());
    87158715
    87168716#ifdef VBOX_WITH_USB
    87178717    /* if captureDeviceForVM() fails, it must have set extended error info */
    87188718    MultiResult rc = mParent->host()->checkUSBProxyService();
    8719     CheckComRCReturnRC (rc);
     8719    CheckComRCReturnRC(rc);
    87208720
    87218721    USBProxyService *service = mParent->host()->usbProxyService();
    8722     AssertReturn (service, E_FAIL);
     8722    AssertReturn(service, E_FAIL);
    87238723    return service->captureDeviceForVM (this, Guid(aId));
    87248724#else
     
    87338733STDMETHODIMP SessionMachine::DetachUSBDevice (IN_BSTR aId, BOOL aDone)
    87348734{
    8735     LogFlowThisFunc (("\n"));
    8736 
    8737     AutoCaller autoCaller (this);
     8735    LogFlowThisFunc(("\n"));
     8736
     8737    AutoCaller autoCaller(this);
    87388738    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    87398739
    87408740#ifdef VBOX_WITH_USB
    87418741    USBProxyService *service = mParent->host()->usbProxyService();
    8742     AssertReturn (service, E_FAIL);
     8742    AssertReturn(service, E_FAIL);
    87438743    return service->detachDeviceFromVM (this, Guid(aId), !!aDone);
    87448744#else
     
    87598759STDMETHODIMP SessionMachine::AutoCaptureUSBDevices()
    87608760{
    8761     LogFlowThisFunc (("\n"));
    8762 
    8763     AutoCaller autoCaller (this);
     8761    LogFlowThisFunc(("\n"));
     8762
     8763    AutoCaller autoCaller(this);
    87648764    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    87658765
     
    87708770
    87718771    USBProxyService *service = mParent->host()->usbProxyService();
    8772     AssertReturn (service, E_FAIL);
     8772    AssertReturn(service, E_FAIL);
    87738773    return service->autoCaptureDevicesForVM (this);
    87748774#else
     
    87898789STDMETHODIMP SessionMachine::DetachAllUSBDevices (BOOL aDone)
    87908790{
    8791     LogFlowThisFunc (("\n"));
    8792 
    8793     AutoCaller autoCaller (this);
     8791    LogFlowThisFunc(("\n"));
     8792
     8793    AutoCaller autoCaller(this);
    87948794    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    87958795
     
    88008800
    88018801    USBProxyService *service = mParent->host()->usbProxyService();
    8802     AssertReturn (service, E_FAIL);
     8802    AssertReturn(service, E_FAIL);
    88038803    return service->detachAllDevicesFromVM (this, !!aDone, false /* aAbnormal */);
    88048804#else
     
    88168816    LogFlowThisFuncEnter();
    88178817
    8818     AssertReturn (aSession, E_INVALIDARG);
    8819     AssertReturn (aProgress, E_INVALIDARG);
    8820 
    8821     AutoCaller autoCaller (this);
    8822 
    8823     LogFlowThisFunc (("state=%d\n", autoCaller.state()));
     8818    AssertReturn(aSession, E_INVALIDARG);
     8819    AssertReturn(aProgress, E_INVALIDARG);
     8820
     8821    AutoCaller autoCaller(this);
     8822
     8823    LogFlowThisFunc(("state=%d\n", autoCaller.state()));
    88248824    /*
    88258825     *  We don't assert below because it might happen that a non-direct session
    88268826     *  informs us it is closed right after we've been uninitialized -- it's ok.
    88278827     */
    8828     CheckComRCReturnRC (autoCaller.rc());
     8828    CheckComRCReturnRC(autoCaller.rc());
    88298829
    88308830    /* get IInternalSessionControl interface */
    8831     ComPtr <IInternalSessionControl> control (aSession);
     8831    ComPtr<IInternalSessionControl> control (aSession);
    88328832
    88338833    ComAssertRet (!control.isNull(), E_INVALIDARG);
    88348834
    8835     AutoWriteLock alock (this);
     8835    AutoWriteLock alock(this);
    88368836
    88378837    if (control.equalsTo (mData->mSession.mDirectControl))
     
    88498849        /* set direct control to NULL to release the remote instance */
    88508850        mData->mSession.mDirectControl.setNull();
    8851         LogFlowThisFunc (("Direct control is set to NULL\n"));
     8851        LogFlowThisFunc(("Direct control is set to NULL\n"));
    88528852
    88538853        /*  Create the progress object the client will use to wait until
    88548854         * #checkForDeath() is called to uninitialize this session object after
    88558855         * it releases the IPC semaphore. */
    8856         ComObjPtr <Progress> progress;
     8856        ComObjPtr<Progress> progress;
    88578857        progress.createObject();
    88588858        progress->init (mParent, static_cast <IMachine *> (mPeer),
    88598859                        Bstr (tr ("Closing session")), FALSE /* aCancelable */);
    8860         progress.queryInterfaceTo (aProgress);
     8860        progress.queryInterfaceTo(aProgress);
    88618861        mData->mSession.mProgress = progress;
    88628862    }
     
    88898889    LogFlowThisFuncEnter();
    88908890
    8891     AssertReturn (aProgress, E_INVALIDARG);
    8892     AssertReturn (aStateFilePath, E_POINTER);
    8893 
    8894     AutoCaller autoCaller (this);
     8891    AssertReturn(aProgress, E_INVALIDARG);
     8892    AssertReturn(aStateFilePath, E_POINTER);
     8893
     8894    AutoCaller autoCaller(this);
    88958895    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    88968896
    8897     AutoWriteLock alock (this);
    8898 
    8899     AssertReturn (mData->mMachineState == MachineState_Paused &&
     8897    AutoWriteLock alock(this);
     8898
     8899    AssertReturn(mData->mMachineState == MachineState_Paused &&
    89008900                  mSnapshotData.mLastState == MachineState_Null &&
    89018901                  mSnapshotData.mProgressId.isEmpty() &&
     
    89278927    setMachineState (MachineState_Saving);
    89288928
    8929     stateFilePath.cloneTo (aStateFilePath);
     8929    stateFilePath.cloneTo(aStateFilePath);
    89308930
    89318931    return S_OK;
     
    89378937STDMETHODIMP SessionMachine::EndSavingState (BOOL aSuccess)
    89388938{
    8939     LogFlowThisFunc (("\n"));
    8940 
    8941     AutoCaller autoCaller (this);
     8939    LogFlowThisFunc(("\n"));
     8940
     8941    AutoCaller autoCaller(this);
    89428942    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    89438943
     
    89458945    AutoMultiWriteLock2 alock (mParent, this);
    89468946
    8947     AssertReturn (mData->mMachineState == MachineState_Saving &&
     8947    AssertReturn(mData->mMachineState == MachineState_Saving &&
    89488948                  mSnapshotData.mLastState != MachineState_Null &&
    89498949                  !mSnapshotData.mProgressId.isEmpty() &&
     
    89708970STDMETHODIMP SessionMachine::AdoptSavedState (IN_BSTR aSavedStateFile)
    89718971{
    8972     LogFlowThisFunc (("\n"));
    8973 
    8974     AssertReturn (aSavedStateFile, E_INVALIDARG);
    8975 
    8976     AutoCaller autoCaller (this);
     8972    LogFlowThisFunc(("\n"));
     8973
     8974    AssertReturn(aSavedStateFile, E_INVALIDARG);
     8975
     8976    AutoCaller autoCaller(this);
    89778977    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    89788978
    8979     AutoWriteLock alock (this);
    8980 
    8981     AssertReturn (mData->mMachineState == MachineState_PoweredOff ||
     8979    AutoWriteLock alock(this);
     8980
     8981    AssertReturn(mData->mMachineState == MachineState_PoweredOff ||
    89828982                  mData->mMachineState == MachineState_Aborted,
    89838983                  E_FAIL);
     
    89858985    Utf8Str stateFilePathFull = aSavedStateFile;
    89868986    int vrc = calculateFullPath (stateFilePathFull, stateFilePathFull);
    8987     if (RT_FAILURE (vrc))
     8987    if (RT_FAILURE(vrc))
    89888988        return setError (VBOX_E_FILE_ERROR,
    89898989            tr ("Invalid saved state file path '%ls' (%Rrc)"),
     
    90089008    LogFlowThisFuncEnter();
    90099009
    9010     AssertReturn (aInitiator && aName, E_INVALIDARG);
    9011     AssertReturn (aStateFilePath && aServerProgress, E_POINTER);
    9012 
    9013     LogFlowThisFunc (("aName='%ls'\n", aName));
    9014 
    9015     AutoCaller autoCaller (this);
     9010    AssertReturn(aInitiator && aName, E_INVALIDARG);
     9011    AssertReturn(aStateFilePath && aServerProgress, E_POINTER);
     9012
     9013    LogFlowThisFunc(("aName='%ls'\n", aName));
     9014
     9015    AutoCaller autoCaller(this);
    90169016    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    90179017
     
    90199019    AutoMultiWriteLock2 alock (mParent, this);
    90209020
    9021     AssertReturn ((!Global::IsOnlineOrTransient (mData->mMachineState) ||
     9021    AssertReturn((!Global::IsOnlineOrTransient (mData->mMachineState) ||
    90229022                   mData->mMachineState == MachineState_Paused) &&
    90239023                  mSnapshotData.mLastState == MachineState_Null &&
     
    90349034         * hard disks are fixed up */
    90359035        HRESULT rc = saveSettings();
    9036         CheckComRCReturnRC (rc);
     9036        CheckComRCReturnRC(rc);
    90379037    }
    90389038
     
    90469046         ++ it)
    90479047    {
    9048         ComObjPtr <HardDisk> hd = (*it)->hardDisk();
     9048        ComObjPtr<HardDisk> hd = (*it)->hardDisk();
    90499049        AutoReadLock hdLock (hd);
    90509050        if (hd->type() == HardDiskType_Writethrough)
     
    90569056#endif
    90579057
    9058     AssertReturn (aProgress || !takingSnapshotOnline, E_FAIL);
     9058    AssertReturn(aProgress || !takingSnapshotOnline, E_FAIL);
    90599059
    90609060    /* create an ID for the snapshot */
     
    90749074    {
    90759075        HRESULT rc = VirtualBox::ensureFilePathExists (Utf8Str (stateFilePath));
    9076         CheckComRCReturnRC (rc);
     9076        CheckComRCReturnRC(rc);
    90779077    }
    90789078
    90799079    /* create a snapshot machine object */
    9080     ComObjPtr <SnapshotMachine> snapshotMachine;
     9080    ComObjPtr<SnapshotMachine> snapshotMachine;
    90819081    snapshotMachine.createObject();
    90829082    HRESULT rc = snapshotMachine->init (this, snapshotId, stateFilePath);
     
    90929092     * hard disks + 1 (if the state is saved so we need to copy it)
    90939093     */
    9094     ComObjPtr <Progress> serverProgress;
     9094    ComObjPtr<Progress> serverProgress;
    90959095    serverProgress.createObject();
    90969096    {
     
    91079107
    91089108    /* create a combined server-side progress object when necessary */
    9109     ComObjPtr <CombinedProgress> combinedProgress;
     9109    ComObjPtr<CombinedProgress> combinedProgress;
    91109110    if (takingSnapshotOnline)
    91119111    {
     
    91189118    /* create a snapshot object */
    91199119    RTTIMESPEC time;
    9120     ComObjPtr <Snapshot> snapshot;
     9120    ComObjPtr<Snapshot> snapshot;
    91219121    snapshot.createObject();
    91229122    rc = snapshot->init(mParent,
     
    91279127                        snapshotMachine,
    91289128                        mData->mCurrentSnapshot);
    9129     AssertComRCReturnRC (rc);
     9129    AssertComRCReturnRC(rc);
    91309130
    91319131    /* create and start the task on a separate thread (note that it will not
     
    91359135                              (void *) task,
    91369136                              0, RTTHREADTYPE_MAIN_WORKER, 0, "TakeSnapshot");
    9137     if (RT_FAILURE (vrc))
     9137    if (RT_FAILURE(vrc))
    91389138    {
    91399139        snapshot->uninit();
     
    91529152
    91539153    if (takingSnapshotOnline)
    9154         stateFilePath.cloneTo (aStateFilePath);
     9154        stateFilePath.cloneTo(aStateFilePath);
    91559155    else
    91569156        *aStateFilePath = NULL;
    91579157
    9158     serverProgress.queryInterfaceTo (aServerProgress);
     9158    serverProgress.queryInterfaceTo(aServerProgress);
    91599159
    91609160    LogFlowThisFuncLeave();
     
    91679167STDMETHODIMP SessionMachine::EndTakingSnapshot (BOOL aSuccess)
    91689168{
    9169     LogFlowThisFunc (("\n"));
    9170 
    9171     AutoCaller autoCaller (this);
     9169    LogFlowThisFunc(("\n"));
     9170
     9171    AutoCaller autoCaller(this);
    91729172    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    91739173
    9174     AutoWriteLock alock (this);
    9175 
    9176     AssertReturn (!aSuccess ||
     9174    AutoWriteLock alock(this);
     9175
     9176    AssertReturn(!aSuccess ||
    91779177                  (mData->mMachineState == MachineState_Saving &&
    91789178                   mSnapshotData.mLastState != MachineState_Null &&
     
    91989198                                             IProgress **aProgress)
    91999199{
    9200     LogFlowThisFunc (("\n"));
     9200    LogFlowThisFunc(("\n"));
    92019201
    92029202    Guid id(aId);
    9203     AssertReturn (aInitiator && !id.isEmpty(), E_INVALIDARG);
    9204     AssertReturn (aMachineState && aProgress, E_POINTER);
    9205 
    9206     AutoCaller autoCaller (this);
     9203    AssertReturn(aInitiator && !id.isEmpty(), E_INVALIDARG);
     9204    AssertReturn(aMachineState && aProgress, E_POINTER);
     9205
     9206    AutoCaller autoCaller(this);
    92079207    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    92089208
     
    92169216    ComObjPtr<Snapshot> snapshot;
    92179217    HRESULT rc = findSnapshot(id, snapshot, true /* aSetError */);
    9218     CheckComRCReturnRC (rc);
     9218    CheckComRCReturnRC(rc);
    92199219
    92209220    AutoWriteLock snapshotLock(snapshot);
     
    92519251     *   1 (preparing) + # of hard disks + 1 if the snapshot is online
    92529252     */
    9253     ComObjPtr <Progress> progress;
     9253    ComObjPtr<Progress> progress;
    92549254    progress.createObject();
    92559255    rc = progress->init (mParent, aInitiator,
     
    92679267                              (void *) task,
    92689268                              0, RTTHREADTYPE_MAIN_WORKER, 0, "DiscardSnapshot");
    9269     if (RT_FAILURE (vrc))
     9269    if (RT_FAILURE(vrc))
    92709270        delete task;
    92719271    ComAssertRCRet (vrc, E_FAIL);
     
    92759275
    92769276    /* return the progress to the caller */
    9277     progress.queryInterfaceTo (aProgress);
     9277    progress.queryInterfaceTo(aProgress);
    92789278
    92799279    /* return the new state to the caller */
     
    92899289    IConsole *aInitiator, MachineState_T *aMachineState, IProgress **aProgress)
    92909290{
    9291     LogFlowThisFunc (("\n"));
    9292 
    9293     AssertReturn (aInitiator, E_INVALIDARG);
    9294     AssertReturn (aMachineState && aProgress, E_POINTER);
    9295 
    9296     AutoCaller autoCaller (this);
     9291    LogFlowThisFunc(("\n"));
     9292
     9293    AssertReturn(aInitiator, E_INVALIDARG);
     9294    AssertReturn(aMachineState && aProgress, E_POINTER);
     9295
     9296    AutoCaller autoCaller(this);
    92979297    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    92989298
    9299     AutoWriteLock alock (this);
     9299    AutoWriteLock alock(this);
    93009300
    93019301    ComAssertRet (!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
     
    93099309    /* create a progress object. The number of operations is: 1 (preparing) + #
    93109310     * of hard disks + 1 (if we need to copy the saved state file) */
    9311     ComObjPtr <Progress> progress;
     9311    ComObjPtr<Progress> progress;
    93129312    progress.createObject();
    93139313    {
     
    93289328                              (void *) task,
    93299329                              0, RTTHREADTYPE_MAIN_WORKER, 0, "DiscardCurState");
    9330     if (RT_FAILURE (vrc))
     9330    if (RT_FAILURE(vrc))
    93319331    {
    93329332        delete task;
     
    93389338
    93399339    /* return the progress to the caller */
    9340     progress.queryInterfaceTo (aProgress);
     9340    progress.queryInterfaceTo(aProgress);
    93419341
    93429342    /* return the new state to the caller */
     
    93539353                                                            IProgress **aProgress)
    93549354{
    9355     LogFlowThisFunc (("\n"));
    9356 
    9357     AssertReturn (aInitiator, E_INVALIDARG);
    9358     AssertReturn (aMachineState && aProgress, E_POINTER);
    9359 
    9360     AutoCaller autoCaller (this);
     9355    LogFlowThisFunc(("\n"));
     9356
     9357    AssertReturn(aInitiator, E_INVALIDARG);
     9358    AssertReturn(aMachineState && aProgress, E_POINTER);
     9359
     9360    AutoCaller autoCaller(this);
    93619361    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    93629362
    9363     AutoWriteLock alock (this);
     9363    AutoWriteLock alock(this);
    93649364
    93659365    ComAssertRet (!Global::IsOnlineOrTransient (mData->mMachineState), E_FAIL);
     
    93809380     *   1 if we need to copy the saved state file of the current snapshot * 2
    93819381     */
    9382     ComObjPtr <Progress> progress;
     9382    ComObjPtr<Progress> progress;
    93839383    progress.createObject();
    93849384    {
     
    94359435
    94369436STDMETHODIMP SessionMachine::
    9437 PullGuestProperties (ComSafeArrayOut (BSTR, aNames),
    9438                      ComSafeArrayOut (BSTR, aValues),
    9439                      ComSafeArrayOut (ULONG64, aTimestamps),
    9440                      ComSafeArrayOut (BSTR, aFlags))
    9441 {
    9442     LogFlowThisFunc (("\n"));
     9437PullGuestProperties (ComSafeArrayOut(BSTR, aNames),
     9438                     ComSafeArrayOut(BSTR, aValues),
     9439                     ComSafeArrayOut(ULONG64, aTimestamps),
     9440                     ComSafeArrayOut(BSTR, aFlags))
     9441{
     9442    LogFlowThisFunc(("\n"));
    94439443
    94449444#ifdef VBOX_WITH_GUEST_PROPS
    94459445    using namespace guestProp;
    94469446
    9447     AutoCaller autoCaller (this);
     9447    AutoCaller autoCaller(this);
    94489448    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    94499449
    9450     AutoReadLock alock (this);
    9451 
    9452     AssertReturn (!ComSafeArrayOutIsNull (aNames), E_POINTER);
    9453     AssertReturn (!ComSafeArrayOutIsNull (aValues), E_POINTER);
    9454     AssertReturn (!ComSafeArrayOutIsNull (aTimestamps), E_POINTER);
    9455     AssertReturn (!ComSafeArrayOutIsNull (aFlags), E_POINTER);
     9450    AutoReadLock alock(this);
     9451
     9452    AssertReturn(!ComSafeArrayOutIsNull(aNames), E_POINTER);
     9453    AssertReturn(!ComSafeArrayOutIsNull(aValues), E_POINTER);
     9454    AssertReturn(!ComSafeArrayOutIsNull(aTimestamps), E_POINTER);
     9455    AssertReturn(!ComSafeArrayOutIsNull(aFlags), E_POINTER);
    94569456
    94579457    size_t cEntries = mHWData->mGuestProperties.size();
    9458     com::SafeArray <BSTR> names (cEntries);
    9459     com::SafeArray <BSTR> values (cEntries);
    9460     com::SafeArray <ULONG64> timestamps (cEntries);
    9461     com::SafeArray <BSTR> flags (cEntries);
     9458    com::SafeArray<BSTR> names (cEntries);
     9459    com::SafeArray<BSTR> values (cEntries);
     9460    com::SafeArray<ULONG64> timestamps (cEntries);
     9461    com::SafeArray<BSTR> flags (cEntries);
    94629462    unsigned i = 0;
    94639463    for (HWData::GuestPropertyList::iterator it = mHWData->mGuestProperties.begin();
     
    94659465    {
    94669466        char szFlags[MAX_FLAGS_LEN + 1];
    9467         it->mName.cloneTo (&names[i]);
    9468         it->mValue.cloneTo (&values[i]);
     9467        it->mName.cloneTo(&names[i]);
     9468        it->mValue.cloneTo(&values[i]);
    94699469        timestamps[i] = it->mTimestamp;
    94709470        writeFlags (it->mFlags, szFlags);
    9471         Bstr (szFlags).cloneTo (&flags[i]);
     9471        Bstr (szFlags).cloneTo(&flags[i]);
    94729472        ++i;
    94739473    }
    9474     names.detachTo (ComSafeArrayOutArg (aNames));
    9475     values.detachTo (ComSafeArrayOutArg (aValues));
    9476     timestamps.detachTo (ComSafeArrayOutArg (aTimestamps));
    9477     flags.detachTo (ComSafeArrayOutArg (aFlags));
     9474    names.detachTo(ComSafeArrayOutArg(aNames));
     9475    values.detachTo(ComSafeArrayOutArg(aValues));
     9476    timestamps.detachTo(ComSafeArrayOutArg(aTimestamps));
     9477    flags.detachTo(ComSafeArrayOutArg(aFlags));
    94789478    mHWData->mPropertyServiceActive = true;
    94799479    return S_OK;
     
    94889488                                                  ComSafeArrayIn (IN_BSTR, aFlags))
    94899489{
    9490     LogFlowThisFunc (("\n"));
     9490    LogFlowThisFunc(("\n"));
    94919491
    94929492#ifdef VBOX_WITH_GUEST_PROPS
    94939493    using namespace guestProp;
    94949494
    9495     AutoCaller autoCaller (this);
     9495    AutoCaller autoCaller(this);
    94969496    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    94979497
    9498     AutoWriteLock alock (this);
     9498    AutoWriteLock alock(this);
    94999499
    95009500    /* Temporarily reset the registered flag, so that our machine state
     
    95049504     * the right way to handle this. */
    95059505    mData->mRegistered = FALSE;
    9506     HRESULT rc = checkStateDependency (MutableStateDep);
    9507     LogRel (("checkStateDependency (MutableStateDep) returned 0x%x\n", rc));
    9508     CheckComRCReturnRC (rc);
     9506    HRESULT rc = checkStateDependency(MutableStateDep);
     9507    LogRel (("checkStateDependency(MutableStateDep) returned 0x%x\n", rc));
     9508    CheckComRCReturnRC(rc);
    95099509
    95109510    // ComAssertRet (mData->mMachineState < MachineState_Running, E_FAIL);
    95119511
    9512     AssertReturn (!ComSafeArrayInIsNull (aNames), E_POINTER);
    9513     AssertReturn (!ComSafeArrayInIsNull (aValues), E_POINTER);
    9514     AssertReturn (!ComSafeArrayInIsNull (aTimestamps), E_POINTER);
    9515     AssertReturn (!ComSafeArrayInIsNull (aFlags), E_POINTER);
    9516 
    9517     com::SafeArray <IN_BSTR> names (ComSafeArrayInArg (aNames));
    9518     com::SafeArray <IN_BSTR> values (ComSafeArrayInArg (aValues));
    9519     com::SafeArray <ULONG64> timestamps (ComSafeArrayInArg (aTimestamps));
    9520     com::SafeArray <IN_BSTR> flags (ComSafeArrayInArg (aFlags));
     9512    AssertReturn(!ComSafeArrayInIsNull (aNames), E_POINTER);
     9513    AssertReturn(!ComSafeArrayInIsNull (aValues), E_POINTER);
     9514    AssertReturn(!ComSafeArrayInIsNull (aTimestamps), E_POINTER);
     9515    AssertReturn(!ComSafeArrayInIsNull (aFlags), E_POINTER);
     9516
     9517    com::SafeArray<IN_BSTR> names (ComSafeArrayInArg (aNames));
     9518    com::SafeArray<IN_BSTR> values (ComSafeArrayInArg (aValues));
     9519    com::SafeArray<ULONG64> timestamps (ComSafeArrayInArg (aTimestamps));
     9520    com::SafeArray<IN_BSTR> flags (ComSafeArrayInArg (aFlags));
    95219521    DiscardSettings();
    95229522    mHWData.backup();
     
    95449544                                                ULONG64 aTimestamp, IN_BSTR aFlags)
    95459545{
    9546     LogFlowThisFunc (("\n"));
     9546    LogFlowThisFunc(("\n"));
    95479547
    95489548#ifdef VBOX_WITH_GUEST_PROPS
     
    95609560
    95619561        uint32_t fFlags = NILFLAG;
    9562         if ((aFlags != NULL) && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags)))
     9562        if ((aFlags != NULL) && RT_FAILURE(validateFlags (utf8Flags.raw(), &fFlags)))
    95639563            return E_INVALIDARG;
    95649564
     
    95679567            matchAll = true;
    95689568
    9569         AutoCaller autoCaller (this);
    9570         CheckComRCReturnRC (autoCaller.rc());
    9571 
    9572         AutoWriteLock alock (this);
    9573 
    9574         HRESULT rc = checkStateDependency (MutableStateDep);
    9575         CheckComRCReturnRC (rc);
     9569        AutoCaller autoCaller(this);
     9570        CheckComRCReturnRC(autoCaller.rc());
     9571
     9572        AutoWriteLock alock(this);
     9573
     9574        HRESULT rc = checkStateDependency(MutableStateDep);
     9575        CheckComRCReturnRC(rc);
    95769576
    95779577        mHWData.backup();
     
    96339633     * will deadlock. */
    96349634    {
    9635         AutoCaller autoCaller (this);
     9635        AutoCaller autoCaller(this);
    96369636        if (!autoCaller.isOk())
    96379637        {
    96389638            /* return true if not ready, to cause the client watcher to exclude
    96399639             * the corresponding session from watching */
    9640             LogFlowThisFunc (("Already uninitialized!"));
     9640            LogFlowThisFunc(("Already uninitialized!"));
    96419641            return true;
    96429642        }
    96439643
    9644         AutoWriteLock alock (this);
     9644        AutoWriteLock alock(this);
    96459645
    96469646        /* Determine the reason of death: if the session state is Closing here,
     
    97019701HRESULT SessionMachine::onDVDDriveChange()
    97029702{
    9703     LogFlowThisFunc (("\n"));
    9704 
    9705     AutoCaller autoCaller (this);
     9703    LogFlowThisFunc(("\n"));
     9704
     9705    AutoCaller autoCaller(this);
    97069706    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    97079707
    9708     ComPtr <IInternalSessionControl> directControl;
    9709     {
    9710         AutoReadLock alock (this);
     9708    ComPtr<IInternalSessionControl> directControl;
     9709    {
     9710        AutoReadLock alock(this);
    97119711        directControl = mData->mSession.mDirectControl;
    97129712    }
     
    97249724HRESULT SessionMachine::onFloppyDriveChange()
    97259725{
    9726     LogFlowThisFunc (("\n"));
    9727 
    9728     AutoCaller autoCaller (this);
     9726    LogFlowThisFunc(("\n"));
     9727
     9728    AutoCaller autoCaller(this);
    97299729    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    97309730
    9731     ComPtr <IInternalSessionControl> directControl;
    9732     {
    9733         AutoReadLock alock (this);
     9731    ComPtr<IInternalSessionControl> directControl;
     9732    {
     9733        AutoReadLock alock(this);
    97349734        directControl = mData->mSession.mDirectControl;
    97359735    }
     
    97479747HRESULT SessionMachine::onNetworkAdapterChange (INetworkAdapter *networkAdapter)
    97489748{
    9749     LogFlowThisFunc (("\n"));
    9750 
    9751     AutoCaller autoCaller (this);
     9749    LogFlowThisFunc(("\n"));
     9750
     9751    AutoCaller autoCaller(this);
    97529752    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    97539753
    9754     ComPtr <IInternalSessionControl> directControl;
    9755     {
    9756         AutoReadLock alock (this);
     9754    ComPtr<IInternalSessionControl> directControl;
     9755    {
     9756        AutoReadLock alock(this);
    97579757        directControl = mData->mSession.mDirectControl;
    97589758    }
     
    97709770HRESULT SessionMachine::onSerialPortChange (ISerialPort *serialPort)
    97719771{
    9772     LogFlowThisFunc (("\n"));
    9773 
    9774     AutoCaller autoCaller (this);
     9772    LogFlowThisFunc(("\n"));
     9773
     9774    AutoCaller autoCaller(this);
    97759775    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    97769776
    9777     ComPtr <IInternalSessionControl> directControl;
    9778     {
    9779         AutoReadLock alock (this);
     9777    ComPtr<IInternalSessionControl> directControl;
     9778    {
     9779        AutoReadLock alock(this);
    97809780        directControl = mData->mSession.mDirectControl;
    97819781    }
     
    97939793HRESULT SessionMachine::onParallelPortChange (IParallelPort *parallelPort)
    97949794{
    9795     LogFlowThisFunc (("\n"));
    9796 
    9797     AutoCaller autoCaller (this);
     9795    LogFlowThisFunc(("\n"));
     9796
     9797    AutoCaller autoCaller(this);
    97989798    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    97999799
    9800     ComPtr <IInternalSessionControl> directControl;
    9801     {
    9802         AutoReadLock alock (this);
     9800    ComPtr<IInternalSessionControl> directControl;
     9801    {
     9802        AutoReadLock alock(this);
    98039803        directControl = mData->mSession.mDirectControl;
    98049804    }
     
    98169816HRESULT SessionMachine::onStorageControllerChange ()
    98179817{
    9818     LogFlowThisFunc (("\n"));
    9819 
    9820     AutoCaller autoCaller (this);
     9818    LogFlowThisFunc(("\n"));
     9819
     9820    AutoCaller autoCaller(this);
    98219821    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    98229822
    9823     ComPtr <IInternalSessionControl> directControl;
    9824     {
    9825         AutoReadLock alock (this);
     9823    ComPtr<IInternalSessionControl> directControl;
     9824    {
     9825        AutoReadLock alock(this);
    98269826        directControl = mData->mSession.mDirectControl;
    98279827    }
     
    98399839HRESULT SessionMachine::onVRDPServerChange()
    98409840{
    9841     LogFlowThisFunc (("\n"));
    9842 
    9843     AutoCaller autoCaller (this);
     9841    LogFlowThisFunc(("\n"));
     9842
     9843    AutoCaller autoCaller(this);
    98449844    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    98459845
    9846     ComPtr <IInternalSessionControl> directControl;
    9847     {
    9848         AutoReadLock alock (this);
     9846    ComPtr<IInternalSessionControl> directControl;
     9847    {
     9848        AutoReadLock alock(this);
    98499849        directControl = mData->mSession.mDirectControl;
    98509850    }
     
    98629862HRESULT SessionMachine::onUSBControllerChange()
    98639863{
    9864     LogFlowThisFunc (("\n"));
    9865 
    9866     AutoCaller autoCaller (this);
     9864    LogFlowThisFunc(("\n"));
     9865
     9866    AutoCaller autoCaller(this);
    98679867    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    98689868
    9869     ComPtr <IInternalSessionControl> directControl;
    9870     {
    9871         AutoReadLock alock (this);
     9869    ComPtr<IInternalSessionControl> directControl;
     9870    {
     9871        AutoReadLock alock(this);
    98729872        directControl = mData->mSession.mDirectControl;
    98739873    }
     
    98859885HRESULT SessionMachine::onSharedFolderChange()
    98869886{
    9887     LogFlowThisFunc (("\n"));
    9888 
    9889     AutoCaller autoCaller (this);
    9890     AssertComRCReturnRC (autoCaller.rc());
    9891 
    9892     ComPtr <IInternalSessionControl> directControl;
    9893     {
    9894         AutoReadLock alock (this);
     9887    LogFlowThisFunc(("\n"));
     9888
     9889    AutoCaller autoCaller(this);
     9890    AssertComRCReturnRC(autoCaller.rc());
     9891
     9892    ComPtr<IInternalSessionControl> directControl;
     9893    {
     9894        AutoReadLock alock(this);
    98959895        directControl = mData->mSession.mDirectControl;
    98969896    }
     
    99099909 *  @note Locks this object for reading.
    99109910 */
    9911 bool SessionMachine::hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
    9912 {
    9913     AutoCaller autoCaller (this);
     9911bool SessionMachine::hasMatchingUSBFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
     9912{
     9913    AutoCaller autoCaller(this);
    99149914    /* silently return if not ready -- this method may be called after the
    99159915     * direct machine session has been called */
     
    99179917        return false;
    99189918
    9919     AutoReadLock alock (this);
     9919    AutoReadLock alock(this);
    99209920
    99219921#ifdef VBOX_WITH_USB
     
    99439943                                           ULONG aMaskedIfs)
    99449944{
    9945     LogFlowThisFunc (("\n"));
    9946 
    9947     AutoCaller autoCaller (this);
     9945    LogFlowThisFunc(("\n"));
     9946
     9947    AutoCaller autoCaller(this);
    99489948
    99499949    /* This notification may happen after the machine object has been
    99509950     * uninitialized (the session was closed), so don't assert. */
    9951     CheckComRCReturnRC (autoCaller.rc());
    9952 
    9953     ComPtr <IInternalSessionControl> directControl;
    9954     {
    9955         AutoReadLock alock (this);
     9951    CheckComRCReturnRC(autoCaller.rc());
     9952
     9953    ComPtr<IInternalSessionControl> directControl;
     9954    {
     9955        AutoReadLock alock(this);
    99569956        directControl = mData->mSession.mDirectControl;
    99579957    }
     
    99759975                                           IVirtualBoxErrorInfo *aError)
    99769976{
    9977     LogFlowThisFunc (("\n"));
    9978 
    9979     AutoCaller autoCaller (this);
     9977    LogFlowThisFunc(("\n"));
     9978
     9979    AutoCaller autoCaller(this);
    99809980
    99819981    /* This notification may happen after the machine object has been
    99829982     * uninitialized (the session was closed), so don't assert. */
    9983     CheckComRCReturnRC (autoCaller.rc());
    9984 
    9985     ComPtr <IInternalSessionControl> directControl;
    9986     {
    9987         AutoReadLock alock (this);
     9983    CheckComRCReturnRC(autoCaller.rc());
     9984
     9985    ComPtr<IInternalSessionControl> directControl;
     9986    {
     9987        AutoReadLock alock(this);
    99889988        directControl = mData->mSession.mDirectControl;
    99899989    }
     
    1001710017    LogFlowThisFuncEnter();
    1001810018
    10019     AutoCaller autoCaller (this);
     10019    AutoCaller autoCaller(this);
    1002010020    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    1002110021
     
    1006510065    LogFlowThisFuncEnter();
    1006610066
    10067     AutoCaller autoCaller (this);
     10067    AutoCaller autoCaller(this);
    1006810068    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    1006910069
    10070     AutoWriteLock alock (this);
    10071 
    10072     AssertReturn (!mSnapshotData.mSnapshot.isNull(), E_FAIL);
     10070    AutoWriteLock alock(this);
     10071
     10072    AssertReturn(!mSnapshotData.mSnapshot.isNull(), E_FAIL);
    1007310073
    1007410074    MultiResult rc (S_OK);
     
    1009710097    }
    1009810098
    10099     if (aSuccess && SUCCEEDED (rc))
     10099    if (aSuccess && SUCCEEDED(rc))
    1010010100    {
    1010110101        bool online = Global::IsOnline (mSnapshotData.mLastState);
     
    1015610156    LogFlowThisFuncEnter();
    1015710157
    10158     AutoCaller autoCaller (this);
    10159 
    10160     LogFlowThisFunc (("state=%d\n", autoCaller.state()));
     10158    AutoCaller autoCaller(this);
     10159
     10160    LogFlowThisFunc(("state=%d\n", autoCaller.state()));
    1016110161    if (!autoCaller.isOk())
    1016210162    {
     
    1016710167    }
    1016810168
    10169     AutoWriteLock alock (this);
     10169    AutoWriteLock alock(this);
    1017010170
    1017110171    HRESULT rc = S_OK;
     
    1017310173    bool online = Global::IsOnline (mSnapshotData.mLastState);
    1017410174
    10175     LogFlowThisFunc (("Creating differencing hard disks (online=%d)...\n",
     10175    LogFlowThisFunc(("Creating differencing hard disks (online=%d)...\n",
    1017610176                      online));
    1017710177
     
    1018310183                              online);
    1018410184
    10185     if (SUCCEEDED (rc) && mSnapshotData.mLastState == MachineState_Saved)
     10185    if (SUCCEEDED(rc) && mSnapshotData.mLastState == MachineState_Saved)
    1018610186    {
    1018710187        Utf8Str stateFrom = mSSData->mStateFilePath;
    1018810188        Utf8Str stateTo = mSnapshotData.mSnapshot->stateFilePath();
    1018910189
    10190         LogFlowThisFunc (("Copying the execution state from '%s' to '%s'...\n",
     10190        LogFlowThisFunc(("Copying the execution state from '%s' to '%s'...\n",
    1019110191                          stateFrom.raw(), stateTo.raw()));
    1019210192
     
    1020510205        alock.enter();
    1020610206
    10207         if (RT_FAILURE (vrc))
     10207        if (RT_FAILURE(vrc))
    1020810208            rc = setError (E_FAIL,
    1020910209                tr ("Could not copy the state file '%s' to '%s' (%Rrc)"),
     
    1021610216    if (!online)
    1021710217    {
    10218         LogFlowThisFunc (("Finalizing the taken snapshot (rc=%Rhrc)...\n", rc));
     10218        LogFlowThisFunc(("Finalizing the taken snapshot (rc=%Rhrc)...\n", rc));
    1021910219
    1022010220        {
     
    1022810228        mSnapshotData.mServerProgress->notifyComplete (rc);
    1022910229
    10230         endTakingSnapshot (SUCCEEDED (rc));
     10230        endTakingSnapshot (SUCCEEDED(rc));
    1023110231    }
    1023210232    else
     
    1028210282    LogFlowThisFuncEnter();
    1028310283
    10284     AutoCaller autoCaller (this);
    10285 
    10286     LogFlowThisFunc (("state=%d\n", autoCaller.state()));
     10284    AutoCaller autoCaller(this);
     10285
     10286    LogFlowThisFunc(("state=%d\n", autoCaller.state()));
    1028710287    if (!autoCaller.isOk())
    1028810288    {
     
    1031710317    {
    1031810318        /* first pass: */
    10319         LogFlowThisFunc (("1: Checking hard disk merge prerequisites...\n"));
     10319        LogFlowThisFunc(("1: Checking hard disk merge prerequisites...\n"));
    1032010320
    1032110321        for (HDData::AttachmentList::const_iterator it = sm->mHDData->mAttachments.begin();
     
    1039610396                {
    1039710397                    /* in snapshot */
    10398                     ComObjPtr <Snapshot> snapshot;
     10398                    ComObjPtr<Snapshot> snapshot;
    1039910399                    rc2 = findSnapshot (snapshotId, snapshot);
    1040010400                    AssertComRC (rc2);
     
    1042710427
    1042810428        /* second pass: */
    10429         LogFlowThisFunc (("2: Discarding snapshot...\n"));
     10429        LogFlowThisFunc(("2: Discarding snapshot...\n"));
    1043010430
    1043110431        {
     
    1046910469
    1047010470        /* third pass: */
    10471         LogFlowThisFunc (("3: Performing actual hard disk merging...\n"));
     10471        LogFlowThisFunc(("3: Performing actual hard disk merging...\n"));
    1047210472
    1047310473        /* leave the locks before the potentially lengthy operation */
     
    1054810548    }
    1054910549
    10550     if (SUCCEEDED (rc))
     10550    if (SUCCEEDED(rc))
    1055110551        mParent->onSnapshotDiscarded (mData->mUuid, snapshotId);
    1055210552
    10553     LogFlowThisFunc (("Done discarding snapshot (rc=%08X)\n", rc));
     10553    LogFlowThisFunc(("Done discarding snapshot (rc=%08X)\n", rc));
    1055410554    LogFlowThisFuncLeave();
    1055510555}
     
    1056510565    LogFlowThisFuncEnter();
    1056610566
    10567     AutoCaller autoCaller (this);
    10568 
    10569     LogFlowThisFunc (("state=%d\n", autoCaller.state()));
     10567    AutoCaller autoCaller(this);
     10568
     10569    LogFlowThisFunc(("state=%d\n", autoCaller.state()));
    1057010570    if (!autoCaller.isOk())
    1057110571    {
     
    1058810588    vboxLock.unlock();
    1058910589
    10590     AutoWriteLock alock (this);
     10590    AutoWriteLock alock(this);
    1059110591
    1059210592    /* discard all current changes to mUserData (name, OSType etc.) (note that
     
    1064410644
    1064510645        {
    10646             ComObjPtr <Snapshot> curSnapshot = mData->mCurrentSnapshot;
     10646            ComObjPtr<Snapshot> curSnapshot = mData->mCurrentSnapshot;
    1064710647            AutoReadLock snapshotLock (curSnapshot);
    1064810648
     
    1065510655            copyFrom(pSnapshotMachine);
    1065610656
    10657             LogFlowThisFunc (("Restoring hard disks from the snapshot...\n"));
     10657            LogFlowThisFunc(("Restoring hard disks from the snapshot...\n"));
    1065810658
    1065910659            /* restore the attachmends from the snapshot */
     
    1069110691                    RTPATH_DELIMITER, mData->mUuid.raw());
    1069210692
    10693                 LogFlowThisFunc (("Copying saved state file from '%s' to '%s'...\n",
     10693                LogFlowThisFunc(("Copying saved state file from '%s' to '%s'...\n",
    1069410694                                  snapStateFilePath.raw(), stateFilePath.raw()));
    1069510695
     
    1070810708                snapshotLock.lock();
    1070910709
    10710                 if (RT_SUCCESS (vrc))
     10710                if (RT_SUCCESS(vrc))
    1071110711                {
    1071210712                    mSSData->mStateFilePath = stateFilePath;
     
    1075610756                /// warning through the Progress object
    1075710757                HRESULT rc2 = (*it)->deleteStorageAndWait();
    10758                 if (SUCCEEDED (rc2))
     10758                if (SUCCEEDED(rc2))
    1075910759                    (*it)->uninit();
    1076010760            }
     
    1082310823        rc = rc2;
    1082410824
    10825         if (SUCCEEDED (rc))
     10825        if (SUCCEEDED(rc))
    1082610826        {
    1082710827            /* now, delete the unused diffs (only on success!) and uninit them*/
     
    1083310833                /// report a warning through the Progress object
    1083410834                HRESULT rc2 = (*it)->deleteStorageAndWait();
    10835                 if (SUCCEEDED (rc2))
     10835                if (SUCCEEDED(rc2))
    1083610836                    (*it)->uninit();
    1083710837            }
     
    1086510865    }
    1086610866
    10867     if (SUCCEEDED (rc))
     10867    if (SUCCEEDED(rc))
    1086810868        mParent->onSnapshotDiscarded (mData->mUuid, Guid());
    1086910869
    10870     LogFlowThisFunc (("Done discarding current state (rc=%08X)\n", rc));
     10870    LogFlowThisFunc(("Done discarding current state (rc=%08X)\n", rc));
    1087110871
    1087210872    LogFlowThisFuncLeave();
     
    1089510895HRESULT SessionMachine::lockMedia()
    1089610896{
    10897     AutoCaller autoCaller (this);
     10897    AutoCaller autoCaller(this);
    1089810898    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    1089910899
    10900     AutoWriteLock alock (this);
    10901 
    10902     AssertReturn (mData->mMachineState == MachineState_Starting ||
     10900    AutoWriteLock alock(this);
     10901
     10902    AssertReturn(mData->mMachineState == MachineState_Starting ||
    1090310903                  mData->mMachineState == MachineState_Restoring, E_FAIL);
    1090410904
    10905     typedef std::list <ComPtr <IMedium> > MediaList;
     10905    typedef std::list <ComPtr<IMedium> > MediaList;
    1090610906    MediaList mediaToCheck;
    1090710907    MediaState_T mediaState;
     
    1093110931                    mData->mSession.mLockedMedia.push_back (
    1093210932                        Data::Session::LockedMedia::value_type (
    10933                             ComPtr <IHardDisk> (hd), true));
     10933                            ComPtr<IHardDisk> (hd), true));
    1093410934
    1093510935                    first = false;
     
    1094210942                    mData->mSession.mLockedMedia.push_back (
    1094310943                        Data::Session::LockedMedia::value_type (
    10944                             ComPtr <IHardDisk> (hd), false));
     10944                            ComPtr<IHardDisk> (hd), false));
    1094510945                }
    1094610946
    1094710947                if (mediaState == MediaState_Inaccessible)
    10948                     mediaToCheck.push_back (ComPtr <IHardDisk> (hd));
     10948                    mediaToCheck.push_back (ComPtr<IHardDisk> (hd));
    1094910949
    1095010950                /* no locks or callers here since there should be no way to
     
    1096010960            if (mDVDDrive->data()->state == DriveState_ImageMounted)
    1096110961            {
    10962                 ComObjPtr <DVDImage> image = mDVDDrive->data()->image;
     10962                ComObjPtr<DVDImage> image = mDVDDrive->data()->image;
    1096310963
    1096410964                rc = image->LockRead (&mediaState);
     
    1096710967                mData->mSession.mLockedMedia.push_back (
    1096810968                    Data::Session::LockedMedia::value_type (
    10969                         ComPtr <IDVDImage> (image), false));
     10969                        ComPtr<IDVDImage> (image), false));
    1097010970
    1097110971                if (mediaState == MediaState_Inaccessible)
    10972                     mediaToCheck.push_back (ComPtr <IDVDImage> (image));
     10972                    mediaToCheck.push_back (ComPtr<IDVDImage> (image));
    1097310973            }
    1097410974        }
     
    1097910979            if (mFloppyDrive->data()->state == DriveState_ImageMounted)
    1098010980            {
    10981                 ComObjPtr <FloppyImage> image = mFloppyDrive->data()->image;
     10981                ComObjPtr<FloppyImage> image = mFloppyDrive->data()->image;
    1098210982
    1098310983                rc = image->LockRead (&mediaState);
     
    1098610986                mData->mSession.mLockedMedia.push_back (
    1098710987                    Data::Session::LockedMedia::value_type (
    10988                         ComPtr <IFloppyImage> (image), false));
     10988                        ComPtr<IFloppyImage> (image), false));
    1098910989
    1099010990                if (mediaState == MediaState_Inaccessible)
    10991                     mediaToCheck.push_back (ComPtr <IFloppyImage> (image));
     10991                    mediaToCheck.push_back (ComPtr<IFloppyImage> (image));
    1099210992            }
    1099310993        }
     
    1105411054void SessionMachine::unlockMedia()
    1105511055{
    11056     AutoCaller autoCaller (this);
     11056    AutoCaller autoCaller(this);
    1105711057    AssertComRCReturnVoid (autoCaller.rc());
    1105811058
    11059     AutoWriteLock alock (this);
     11059    AutoWriteLock alock(this);
    1106011060
    1106111061    /* we may be holding important error info on the current thread;
     
    1107811078         * Machine::fixupHardDisks(). The last can happen when e.g a DVD/Floppy
    1107911079         * image was unmounted at runtime. */
    11080         Assert (SUCCEEDED (rc) || state == MediaState_LockedRead || state == MediaState_Created);
     11080        Assert (SUCCEEDED(rc) || state == MediaState_LockedRead || state == MediaState_Created);
    1108111081    }
    1108211082
     
    1109211092{
    1109311093    LogFlowThisFuncEnter();
    11094     LogFlowThisFunc (("aMachineState=%d\n", aMachineState));
    11095 
    11096     AutoCaller autoCaller (this);
     11094    LogFlowThisFunc(("aMachineState=%d\n", aMachineState));
     11095
     11096    AutoCaller autoCaller(this);
    1109711097    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    1109811098
    11099     AutoWriteLock alock (this);
     11099    AutoWriteLock alock(this);
    1110011100
    1110111101    MachineState_T oldMachineState = mData->mMachineState;
     
    1123811238    }
    1123911239
    11240     LogFlowThisFunc (("rc=%08X\n", rc));
     11240    LogFlowThisFunc(("rc=%08X\n", rc));
    1124111241    LogFlowThisFuncLeave();
    1124211242    return rc;
     
    1125011250HRESULT SessionMachine::updateMachineStateOnClient()
    1125111251{
    11252     AutoCaller autoCaller (this);
     11252    AutoCaller autoCaller(this);
    1125311253    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    1125411254
    11255     ComPtr <IInternalSessionControl> directControl;
    11256     {
    11257         AutoReadLock alock (this);
    11258         AssertReturn (!!mData, E_FAIL);
     11255    ComPtr<IInternalSessionControl> directControl;
     11256    {
     11257        AutoReadLock alock(this);
     11258        AssertReturn(!!mData, E_FAIL);
    1125911259        directControl = mData->mSession.mDirectControl;
    1126011260
     
    1127111271            return S_OK;
    1127211272
    11273         AssertReturn (!directControl.isNull(), E_FAIL);
     11273        AssertReturn(!directControl.isNull(), E_FAIL);
    1127411274    }
    1127511275
     
    1128011280DECLCALLBACK(int) SessionMachine::taskHandler (RTTHREAD /* thread */, void *pvUser)
    1128111281{
    11282     AssertReturn (pvUser, VERR_INVALID_POINTER);
     11282    AssertReturn(pvUser, VERR_INVALID_POINTER);
    1128311283
    1128411284    Task *task = static_cast <Task *> (pvUser);
     
    1129911299HRESULT SnapshotMachine::FinalConstruct()
    1130011300{
    11301     LogFlowThisFunc (("\n"));
     11301    LogFlowThisFunc(("\n"));
    1130211302
    1130311303    /* set the proper type to indicate we're the SnapshotMachine instance */
    11304     unconst (mType) = IsSnapshotMachine;
     11304    unconst(mType) = IsSnapshotMachine;
    1130511305
    1130611306    return S_OK;
     
    1130911309void SnapshotMachine::FinalRelease()
    1131011310{
    11311     LogFlowThisFunc (("\n"));
     11311    LogFlowThisFunc(("\n"));
    1131211312
    1131311313    uninit();
     
    1132911329{
    1133011330    LogFlowThisFuncEnter();
    11331     LogFlowThisFunc (("mName={%ls}\n", aSessionMachine->mUserData->mName.raw()));
    11332 
    11333     AssertReturn (aSessionMachine && !Guid (aSnapshotId).isEmpty(), E_INVALIDARG);
     11331    LogFlowThisFunc(("mName={%ls}\n", aSessionMachine->mUserData->mName.raw()));
     11332
     11333    AssertReturn(aSessionMachine && !Guid (aSnapshotId).isEmpty(), E_INVALIDARG);
    1133411334
    1133511335    /* Enclose the state transition NotReady->InInit->Ready */
    11336     AutoInitSpan autoInitSpan (this);
    11337     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    11338 
    11339     AssertReturn (aSessionMachine->isWriteLockOnCurrentThread(), E_FAIL);
     11336    AutoInitSpan autoInitSpan(this);
     11337    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     11338
     11339    AssertReturn(aSessionMachine->isWriteLockOnCurrentThread(), E_FAIL);
    1134011340
    1134111341    mSnapshotId = aSnapshotId;
    1134211342
    1134311343    /* memorize the primary Machine instance (i.e. not SessionMachine!) */
    11344     unconst (mPeer) = aSessionMachine->mPeer;
     11344    unconst(mPeer) = aSessionMachine->mPeer;
    1134511345    /* share the parent pointer */
    11346     unconst (mParent) = mPeer->mParent;
     11346    unconst(mParent) = mPeer->mParent;
    1134711347
    1134811348    /* take the pointer to Data to share */
     
    1136911369         ++ it)
    1137011370    {
    11371         ComObjPtr <SharedFolder> folder;
     11371        ComObjPtr<SharedFolder> folder;
    1137211372        folder.createObject();
    1137311373        rc = folder->initCopy (this, *it);
    11374         CheckComRCReturnRC (rc);
     11374        CheckComRCReturnRC(rc);
    1137511375        *it = folder;
    1137611376    }
     
    1139511395         ++ it)
    1139611396    {
    11397         ComObjPtr <StorageController> ctrl;
     11397        ComObjPtr<StorageController> ctrl;
    1139811398        ctrl.createObject();
    1139911399        ctrl->initCopy (this, *it);
     
    1140311403    /* create all other child objects that will be immutable private copies */
    1140411404
    11405     unconst (mBIOSSettings).createObject();
     11405    unconst(mBIOSSettings).createObject();
    1140611406    mBIOSSettings->initCopy (this, mPeer->mBIOSSettings);
    1140711407
    1140811408#ifdef VBOX_WITH_VRDP
    11409     unconst (mVRDPServer).createObject();
     11409    unconst(mVRDPServer).createObject();
    1141011410    mVRDPServer->initCopy (this, mPeer->mVRDPServer);
    1141111411#endif
    1141211412
    11413     unconst (mDVDDrive).createObject();
     11413    unconst(mDVDDrive).createObject();
    1141411414    mDVDDrive->initCopy (this, mPeer->mDVDDrive);
    1141511415
    11416     unconst (mFloppyDrive).createObject();
     11416    unconst(mFloppyDrive).createObject();
    1141711417    mFloppyDrive->initCopy (this, mPeer->mFloppyDrive);
    1141811418
    11419     unconst (mAudioAdapter).createObject();
     11419    unconst(mAudioAdapter).createObject();
    1142011420    mAudioAdapter->initCopy (this, mPeer->mAudioAdapter);
    1142111421
    11422     unconst (mUSBController).createObject();
     11422    unconst(mUSBController).createObject();
    1142311423    mUSBController->initCopy (this, mPeer->mUSBController);
    1142411424
    1142511425    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1142611426    {
    11427         unconst (mNetworkAdapters [slot]).createObject();
     11427        unconst(mNetworkAdapters [slot]).createObject();
    1142811428        mNetworkAdapters [slot]->initCopy (this, mPeer->mNetworkAdapters [slot]);
    1142911429    }
     
    1143111431    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1143211432    {
    11433         unconst (mSerialPorts [slot]).createObject();
     11433        unconst(mSerialPorts [slot]).createObject();
    1143411434        mSerialPorts [slot]->initCopy (this, mPeer->mSerialPorts [slot]);
    1143511435    }
     
    1143711437    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1143811438    {
    11439         unconst (mParallelPorts [slot]).createObject();
     11439        unconst(mParallelPorts [slot]).createObject();
    1144011440        mParallelPorts [slot]->initCopy (this, mPeer->mParallelPorts [slot]);
    1144111441    }
     
    1146611466{
    1146711467    LogFlowThisFuncEnter();
    11468     LogFlowThisFunc (("mName={%ls}\n", aMachine->mUserData->mName.raw()));
    11469 
    11470     AssertReturn (aMachine && !aHWNode.isNull() && !aHDAsNode.isNull() &&
     11468    LogFlowThisFunc(("mName={%ls}\n", aMachine->mUserData->mName.raw()));
     11469
     11470    AssertReturn(aMachine && !aHWNode.isNull() && !aHDAsNode.isNull() &&
    1147111471                  !Guid (aSnapshotId).isEmpty(),
    1147211472                  E_INVALIDARG);
    1147311473
    1147411474    /* Enclose the state transition NotReady->InInit->Ready */
    11475     AutoInitSpan autoInitSpan (this);
    11476     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     11475    AutoInitSpan autoInitSpan(this);
     11476    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    1147711477
    1147811478    /* Don't need to lock aMachine when VirtualBox is starting up */
     
    1148111481
    1148211482    /* memorize the primary Machine instance */
    11483     unconst (mPeer) = aMachine;
     11483    unconst(mPeer) = aMachine;
    1148411484    /* share the parent pointer */
    11485     unconst (mParent) = mPeer->mParent;
     11485    unconst(mParent) = mPeer->mParent;
    1148611486
    1148711487    /* take the pointer to Data to share */
     
    1150311503    /* create all other child objects that will be immutable private copies */
    1150411504
    11505     unconst (mBIOSSettings).createObject();
     11505    unconst(mBIOSSettings).createObject();
    1150611506    mBIOSSettings->init (this);
    1150711507
    1150811508#ifdef VBOX_WITH_VRDP
    11509     unconst (mVRDPServer).createObject();
     11509    unconst(mVRDPServer).createObject();
    1151011510    mVRDPServer->init (this);
    1151111511#endif
    1151211512
    11513     unconst (mDVDDrive).createObject();
     11513    unconst(mDVDDrive).createObject();
    1151411514    mDVDDrive->init (this);
    1151511515
    11516     unconst (mFloppyDrive).createObject();
     11516    unconst(mFloppyDrive).createObject();
    1151711517    mFloppyDrive->init (this);
    1151811518
    11519     unconst (mAudioAdapter).createObject();
     11519    unconst(mAudioAdapter).createObject();
    1152011520    mAudioAdapter->init (this);
    1152111521
    11522     unconst (mUSBController).createObject();
     11522    unconst(mUSBController).createObject();
    1152311523    mUSBController->init (this);
    1152411524
    1152511525    for (ULONG slot = 0; slot < RT_ELEMENTS (mNetworkAdapters); slot ++)
    1152611526    {
    11527         unconst (mNetworkAdapters [slot]).createObject();
     11527        unconst(mNetworkAdapters [slot]).createObject();
    1152811528        mNetworkAdapters [slot]->init (this, slot);
    1152911529    }
     
    1153111531    for (ULONG slot = 0; slot < RT_ELEMENTS (mSerialPorts); slot ++)
    1153211532    {
    11533         unconst (mSerialPorts [slot]).createObject();
     11533        unconst(mSerialPorts [slot]).createObject();
    1153411534        mSerialPorts [slot]->init (this, slot);
    1153511535    }
     
    1153711537    for (ULONG slot = 0; slot < RT_ELEMENTS (mParallelPorts); slot ++)
    1153811538    {
    11539         unconst (mParallelPorts [slot]).createObject();
     11539        unconst(mParallelPorts [slot]).createObject();
    1154011540        mParallelPorts [slot]->init (this, slot);
    1154111541    }
     
    1154411544
    1154511545    HRESULT rc = loadHardware (aHWNode);
    11546     if (SUCCEEDED (rc))
     11546    if (SUCCEEDED(rc))
    1154711547        rc = loadStorageControllers (aHDAsNode, true /* aRegistered */, &mSnapshotId);
    1154811548
    11549     if (SUCCEEDED (rc))
     11549    if (SUCCEEDED(rc))
    1155011550    {
    1155111551        /* commit all changes made during the initialization */
     
    1155411554
    1155511555    /* Confirm a successful initialization when it's the case */
    11556     if (SUCCEEDED (rc))
     11556    if (SUCCEEDED(rc))
    1155711557        autoInitSpan.setSucceeded();
    1155811558
     
    1156911569
    1157011570    /* Enclose the state transition Ready->InUninit->NotReady */
    11571     AutoUninitSpan autoUninitSpan (this);
     11571    AutoUninitSpan autoUninitSpan(this);
    1157211572    if (autoUninitSpan.uninitDone())
    1157311573        return;
     
    1157811578    mData.free();
    1157911579
    11580     unconst (mParent).setNull();
    11581     unconst (mPeer).setNull();
     11580    unconst(mParent).setNull();
     11581    unconst(mPeer).setNull();
    1158211582
    1158311583    LogFlowThisFuncLeave();
     
    1159311593RWLockHandle *SnapshotMachine::lockHandle() const
    1159411594{
    11595     AssertReturn (!mPeer.isNull(), NULL);
     11595    AssertReturn(!mPeer.isNull(), NULL);
    1159611596    return mPeer->lockHandle();
    1159711597}
     
    1160811608HRESULT SnapshotMachine::onSnapshotChange (Snapshot *aSnapshot)
    1160911609{
    11610     AutoWriteLock alock (this);
     11610    AutoWriteLock alock(this);
    1161111611
    1161211612    mPeer->saveSnapshotSettings (aSnapshot, SaveSS_UpdateAttrsOp);
  • trunk/src/VBox/Main/Matching.cpp

    r14772 r21878  
    112112        vrc = RTStrToUInt64Ex(aFilter + aStart, &endptr, 0, &val.ull);
    113113
    114     AssertReturn (endptr, 0);
     114    AssertReturn(endptr, 0);
    115115
    116116    size_t parsed = endptr - aFilter;
  • trunk/src/VBox/Main/MediumImpl.cpp

    r20977 r21878  
    5454STDMETHODIMP MediumBase::COMGETTER(Id) (BSTR *aId)
    5555{
    56     CheckComArgOutPointerValid (aId);
    57 
    58     AutoCaller autoCaller (this);
    59     CheckComRCReturnRC (autoCaller.rc());
    60 
    61     AutoReadLock alock (this);
    62 
    63     m.id.toUtf16().cloneTo (aId);
     56    CheckComArgOutPointerValid(aId);
     57
     58    AutoCaller autoCaller(this);
     59    CheckComRCReturnRC(autoCaller.rc());
     60
     61    AutoReadLock alock(this);
     62
     63    m.id.toUtf16().cloneTo(aId);
    6464
    6565    return S_OK;
     
    6868STDMETHODIMP MediumBase::COMGETTER(Description) (BSTR *aDescription)
    6969{
    70     CheckComArgOutPointerValid (aDescription);
    71 
    72     AutoCaller autoCaller (this);
    73     CheckComRCReturnRC (autoCaller.rc());
    74 
    75     AutoReadLock alock (this);
     70    CheckComArgOutPointerValid(aDescription);
     71
     72    AutoCaller autoCaller(this);
     73    CheckComRCReturnRC(autoCaller.rc());
     74
     75    AutoReadLock alock(this);
    7676
    7777    if (m.description.isEmpty())
    7878        Bstr("").cloneTo(aDescription);
    7979    else
    80         m.description.cloneTo (aDescription);
     80        m.description.cloneTo(aDescription);
    8181
    8282    return S_OK;
     
    8787    CheckComArgNotNull (aDescription);
    8888
    89     AutoCaller autoCaller (this);
    90     CheckComRCReturnRC (autoCaller.rc());
    91 
    92     AutoWriteLock alock (this);
     89    AutoCaller autoCaller(this);
     90    CheckComRCReturnRC(autoCaller.rc());
     91
     92    AutoWriteLock alock(this);
    9393
    9494    /// @todo update m.description and save the global registry (and local
     
    103103    CheckComArgOutPointerValid(aState);
    104104
    105     AutoCaller autoCaller (this);
    106     CheckComRCReturnRC (autoCaller.rc());
     105    AutoCaller autoCaller(this);
     106    CheckComRCReturnRC(autoCaller.rc());
    107107
    108108    /* queryInfo() locks this for writing. */
    109     AutoWriteLock alock (this);
     109    AutoWriteLock alock(this);
    110110
    111111    HRESULT rc = S_OK;
     
    134134    CheckComArgOutPointerValid(aLocation);
    135135
    136     AutoCaller autoCaller (this);
    137     CheckComRCReturnRC (autoCaller.rc());
    138 
    139     AutoReadLock alock (this);
    140 
    141     m.locationFull.cloneTo (aLocation);
     136    AutoCaller autoCaller(this);
     137    CheckComRCReturnRC(autoCaller.rc());
     138
     139    AutoReadLock alock(this);
     140
     141    m.locationFull.cloneTo(aLocation);
    142142
    143143    return S_OK;
     
    148148    CheckComArgNotNull (aLocation);
    149149
    150     AutoCaller autoCaller (this);
    151     CheckComRCReturnRC (autoCaller.rc());
    152 
    153     AutoWriteLock alock (this);
     150    AutoCaller autoCaller(this);
     151    CheckComRCReturnRC(autoCaller.rc());
     152
     153    AutoWriteLock alock(this);
    154154
    155155    /// @todo NEWMEDIA for file names, add the default extension if no extension
     
    167167STDMETHODIMP MediumBase::COMGETTER(Name) (BSTR *aName)
    168168{
    169     CheckComArgOutPointerValid (aName);
    170 
    171     AutoCaller autoCaller (this);
    172     CheckComRCReturnRC (autoCaller.rc());
    173 
    174     AutoReadLock alock (this);
    175 
    176     name().cloneTo (aName);
     169    CheckComArgOutPointerValid(aName);
     170
     171    AutoCaller autoCaller(this);
     172    CheckComRCReturnRC(autoCaller.rc());
     173
     174    AutoReadLock alock(this);
     175
     176    name().cloneTo(aName);
    177177
    178178    return S_OK;
     
    181181STDMETHODIMP MediumBase::COMGETTER(Size) (ULONG64 *aSize)
    182182{
    183     CheckComArgOutPointerValid (aSize);
    184 
    185     AutoCaller autoCaller (this);
    186     CheckComRCReturnRC (autoCaller.rc());
    187 
    188     AutoReadLock alock (this);
     183    CheckComArgOutPointerValid(aSize);
     184
     185    AutoCaller autoCaller(this);
     186    CheckComRCReturnRC(autoCaller.rc());
     187
     188    AutoReadLock alock(this);
    189189
    190190    *aSize = m.size;
     
    195195STDMETHODIMP MediumBase::COMGETTER(LastAccessError) (BSTR *aLastAccessError)
    196196{
    197     CheckComArgOutPointerValid (aLastAccessError);
    198 
    199     AutoCaller autoCaller (this);
    200     CheckComRCReturnRC (autoCaller.rc());
    201 
    202     AutoReadLock alock (this);
     197    CheckComArgOutPointerValid(aLastAccessError);
     198
     199    AutoCaller autoCaller(this);
     200    CheckComRCReturnRC(autoCaller.rc());
     201
     202    AutoReadLock alock(this);
    203203
    204204    if (m.lastAccessError.isEmpty())
    205205        Bstr("").cloneTo(aLastAccessError);
    206206    else
    207         m.lastAccessError.cloneTo (aLastAccessError);
    208 
    209     return S_OK;
    210 }
    211 
    212 STDMETHODIMP MediumBase::COMGETTER(MachineIds) (ComSafeArrayOut (BSTR,aMachineIds))
     207        m.lastAccessError.cloneTo(aLastAccessError);
     208
     209    return S_OK;
     210}
     211
     212STDMETHODIMP MediumBase::COMGETTER(MachineIds) (ComSafeArrayOut(BSTR,aMachineIds))
    213213{
    214214    if (ComSafeGUIDArrayOutIsNull (aMachineIds))
    215215        return E_POINTER;
    216216
    217     AutoCaller autoCaller (this);
    218     CheckComRCReturnRC (autoCaller.rc());
    219 
    220     AutoReadLock alock (this);
     217    AutoCaller autoCaller(this);
     218    CheckComRCReturnRC(autoCaller.rc());
     219
     220    AutoReadLock alock(this);
    221221
    222222    com::SafeArray<BSTR> machineIds;
     
    234234    }
    235235
    236     machineIds.detachTo (ComSafeArrayOutArg (aMachineIds));
     236    machineIds.detachTo(ComSafeArrayOutArg(aMachineIds));
    237237
    238238    return S_OK;
     
    243243
    244244STDMETHODIMP MediumBase::GetSnapshotIds (IN_BSTR aMachineId,
    245                                          ComSafeArrayOut (BSTR, aSnapshotIds))
     245                                         ComSafeArrayOut(BSTR, aSnapshotIds))
    246246{
    247247    CheckComArgExpr (aMachineId, Guid (aMachineId).isEmpty() == false);
    248     CheckComArgOutSafeArrayPointerValid (aSnapshotIds);
    249 
    250     AutoCaller autoCaller (this);
    251     CheckComRCReturnRC (autoCaller.rc());
    252 
    253     AutoReadLock alock (this);
     248    CheckComArgOutSafeArrayPointerValid(aSnapshotIds);
     249
     250    AutoCaller autoCaller(this);
     251    CheckComRCReturnRC(autoCaller.rc());
     252
     253    AutoReadLock alock(this);
    254254
    255255    com::SafeArray<BSTR> snapshotIds;
     
    288288    }
    289289
    290     snapshotIds.detachTo (ComSafeArrayOutArg (aSnapshotIds));
     290    snapshotIds.detachTo(ComSafeArrayOutArg(aSnapshotIds));
    291291
    292292    return S_OK;
     
    299299STDMETHODIMP MediumBase::LockRead (MediaState_T *aState)
    300300{
    301     AutoCaller autoCaller (this);
    302     CheckComRCReturnRC (autoCaller.rc());
    303 
    304     AutoWriteLock alock (this);
     301    AutoCaller autoCaller(this);
     302    CheckComRCReturnRC(autoCaller.rc());
     303
     304    AutoWriteLock alock(this);
    305305
    306306    /* return the current state before */
     
    346346STDMETHODIMP MediumBase::UnlockRead (MediaState_T *aState)
    347347{
    348     AutoCaller autoCaller (this);
    349     CheckComRCReturnRC (autoCaller.rc());
    350 
    351     AutoWriteLock alock (this);
     348    AutoCaller autoCaller(this);
     349    CheckComRCReturnRC(autoCaller.rc());
     350
     351    AutoWriteLock alock(this);
    352352
    353353    HRESULT rc = S_OK;
     
    398398STDMETHODIMP MediumBase::LockWrite (MediaState_T *aState)
    399399{
    400     AutoCaller autoCaller (this);
    401     CheckComRCReturnRC (autoCaller.rc());
    402 
    403     AutoWriteLock alock (this);
     400    AutoCaller autoCaller(this);
     401    CheckComRCReturnRC(autoCaller.rc());
     402
     403    AutoWriteLock alock(this);
    404404
    405405    /* return the current state before */
     
    438438STDMETHODIMP MediumBase::UnlockWrite (MediaState_T *aState)
    439439{
    440     AutoCaller autoCaller (this);
    441     CheckComRCReturnRC (autoCaller.rc());
    442 
    443     AutoWriteLock alock (this);
     440    AutoCaller autoCaller(this);
     441    CheckComRCReturnRC(autoCaller.rc());
     442
     443    AutoWriteLock alock(this);
    444444
    445445    HRESULT rc = S_OK;
     
    474474{
    475475    AutoMayUninitSpan mayUninitSpan (this);
    476     CheckComRCReturnRC (mayUninitSpan.rc());
     476    CheckComRCReturnRC(mayUninitSpan.rc());
    477477
    478478    if (mayUninitSpan.alreadyInProgress())
     
    509509    /* perform extra media-dependent close checks */
    510510    HRESULT rc = canClose();
    511     CheckComRCReturnRC (rc);
     511    CheckComRCReturnRC(rc);
    512512
    513513    if (wasCreated)
     
    517517         * failure to do so) */
    518518        rc = unregisterWithVirtualBox();
    519         CheckComRCReturnRC (rc);
     519        CheckComRCReturnRC(rc);
    520520    }
    521521
     
    540540HRESULT MediumBase::updatePath (const char *aOldPath, const char *aNewPath)
    541541{
    542     AssertReturn (aOldPath, E_FAIL);
    543     AssertReturn (aNewPath, E_FAIL);
    544 
    545     AutoCaller autoCaller (this);
    546     CheckComRCReturnRC (autoCaller.rc());
    547 
    548     AutoWriteLock alock (this);
    549 
    550     LogFlowThisFunc (("locationFull.before='%s'\n", m.locationFull.raw()));
     542    AssertReturn(aOldPath, E_FAIL);
     543    AssertReturn(aNewPath, E_FAIL);
     544
     545    AutoCaller autoCaller(this);
     546    CheckComRCReturnRC(autoCaller.rc());
     547
     548    AutoWriteLock alock(this);
     549
     550    LogFlowThisFunc(("locationFull.before='%s'\n", m.locationFull.raw()));
    551551
    552552    Utf8Str path = m.locationFull;
     
    560560        mVirtualBox->calculateRelativePath (path, path);
    561561
    562         unconst (m.locationFull) = newPath;
    563         unconst (m.location) = path;
    564 
    565         LogFlowThisFunc (("locationFull.after='%s'\n", m.locationFull.raw()));
     562        unconst(m.locationFull) = newPath;
     563        unconst(m.location) = path;
     564
     565        LogFlowThisFunc(("locationFull.after='%s'\n", m.locationFull.raw()));
    566566    }
    567567
     
    579579                              const Guid &aSnapshotId /*= Guid::Empty*/)
    580580{
    581     AssertReturn (!aMachineId.isEmpty(), E_FAIL);
    582 
    583     AutoCaller autoCaller (this);
    584     AssertComRCReturnRC (autoCaller.rc());
    585 
    586     AutoWriteLock alock (this);
     581    AssertReturn(!aMachineId.isEmpty(), E_FAIL);
     582
     583    AutoCaller autoCaller(this);
     584    AssertComRCReturnRC(autoCaller.rc());
     585
     586    AutoWriteLock alock(this);
    587587
    588588    switch (m.state)
     
    599599
    600600    HRESULT rc = canAttach (aMachineId, aSnapshotId);
    601     CheckComRCReturnRC (rc);
     601    CheckComRCReturnRC(rc);
    602602
    603603    BackRefList::iterator it =
     
    615615    {
    616616        /* sanity: no duplicate attachments */
    617         AssertReturn (!it->inCurState, E_FAIL);
     617        AssertReturn(!it->inCurState, E_FAIL);
    618618        it->inCurState = true;
    619619
     
    624624    BackRef::GuidList::const_iterator jt =
    625625        std::find (it->snapshotIds.begin(), it->snapshotIds.end(), aSnapshotId);
    626     AssertReturn (jt == it->snapshotIds.end(), E_FAIL);
     626    AssertReturn(jt == it->snapshotIds.end(), E_FAIL);
    627627
    628628    it->snapshotIds.push_back (aSnapshotId);
     
    642642                                const Guid &aSnapshotId /*= Guid::Empty*/)
    643643{
    644     AssertReturn (!aMachineId.isEmpty(), E_FAIL);
    645 
    646     AutoCaller autoCaller (this);
    647     AssertComRCReturnRC (autoCaller.rc());
    648 
    649     AutoWriteLock alock (this);
     644    AssertReturn(!aMachineId.isEmpty(), E_FAIL);
     645
     646    AutoCaller autoCaller(this);
     647    AssertComRCReturnRC(autoCaller.rc());
     648
     649    AutoWriteLock alock(this);
    650650
    651651    BackRefList::iterator it =
    652652        std::find_if (m.backRefs.begin(), m.backRefs.end(),
    653653                      BackRef::EqualsTo (aMachineId));
    654     AssertReturn (it != m.backRefs.end(), E_FAIL);
     654    AssertReturn(it != m.backRefs.end(), E_FAIL);
    655655
    656656    if (aSnapshotId.isEmpty())
     
    665665            std::find (it->snapshotIds.begin(), it->snapshotIds.end(), aSnapshotId);
    666666
    667         AssertReturn (jt != it->snapshotIds.end(), E_FAIL);
     667        AssertReturn(jt != it->snapshotIds.end(), E_FAIL);
    668668        it->snapshotIds.erase (jt);
    669669    }
     
    705705    Utf8Str locationFull;
    706706    int vrc = mVirtualBox->calculateFullPath (Utf8Str (aLocation), locationFull);
    707     if (RT_FAILURE (vrc))
     707    if (RT_FAILURE(vrc))
    708708        return setError (E_FAIL,
    709709            tr ("Invalid image file location '%ls' (%Rrc)"),
     
    729729HRESULT MediumBase::queryInfo()
    730730{
    731     AutoWriteLock alock (this);
    732 
    733     AssertReturn (m.state == MediaState_Created ||
     731    AutoWriteLock alock(this);
     732
     733    AssertReturn(m.state == MediaState_Created ||
    734734                  m.state == MediaState_Inaccessible ||
    735735                  m.state == MediaState_LockedRead ||
     
    791791        RTFILE file;
    792792        vrc = RTFileOpen (&file, Utf8Str (m.locationFull), RTFILE_O_READ);
    793         if (RT_SUCCESS (vrc))
     793        if (RT_SUCCESS(vrc))
    794794        {
    795795            vrc = RTFileGetSize (file, &m.size);
     
    798798        }
    799799
    800         if (RT_FAILURE (vrc))
     800        if (RT_FAILURE(vrc))
    801801        {
    802802            m.lastAccessError = Utf8StrFmt (
     
    805805        }
    806806
    807         success = (RT_SUCCESS (vrc));
     807        success = (RT_SUCCESS(vrc));
    808808    }
    809809
     
    940940                                        const Guid &aId)
    941941{
    942     LogFlowThisFunc (("aLocation='%ls', aId={%RTuuid}\n", aLocation, aId.raw()));
    943 
    944     AssertReturn (aVirtualBox, E_INVALIDARG);
    945     AssertReturn (aLocation, E_INVALIDARG);
    946     AssertReturn (!aId.isEmpty(), E_INVALIDARG);
     942    LogFlowThisFunc(("aLocation='%ls', aId={%RTuuid}\n", aLocation, aId.raw()));
     943
     944    AssertReturn(aVirtualBox, E_INVALIDARG);
     945    AssertReturn(aLocation, E_INVALIDARG);
     946    AssertReturn(!aId.isEmpty(), E_INVALIDARG);
    947947
    948948    /* Enclose the state transition NotReady->InInit->Ready */
    949     AutoInitSpan autoInitSpan (this);
    950     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     949    AutoInitSpan autoInitSpan(this);
     950    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    951951
    952952    HRESULT rc = S_OK;
    953953
    954954    /* share parent weakly */
    955     unconst (mVirtualBox) = aVirtualBox;
     955    unconst(mVirtualBox) = aVirtualBox;
    956956
    957957    /* register with parent early, since uninit() will unconditionally
     
    962962    m.state = MediaState_Created;
    963963
    964     unconst (m.id) = aId;
     964    unconst(m.id) = aId;
    965965    rc = setLocation (aLocation);
    966     CheckComRCReturnRC (rc);
    967 
    968     LogFlowThisFunc (("m.locationFull='%ls'\n", m.locationFull.raw()));
     966    CheckComRCReturnRC(rc);
     967
     968    LogFlowThisFunc(("m.locationFull='%ls'\n", m.locationFull.raw()));
    969969
    970970    /* get all the information about the medium from the file */
     
    980980
    981981    /* Confirm a successful initialization when it's the case */
    982     if (SUCCEEDED (rc))
     982    if (SUCCEEDED(rc))
    983983        autoInitSpan.setSucceeded();
    984984
     
    998998                                        const settings::Key &aImageNode)
    999999{
    1000     AssertReturn (aVirtualBox, E_INVALIDARG);
     1000    AssertReturn(aVirtualBox, E_INVALIDARG);
    10011001
    10021002    /* Enclose the state transition NotReady->InInit->Ready */
    1003     AutoInitSpan autoInitSpan (this);
    1004     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     1003    AutoInitSpan autoInitSpan(this);
     1004    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    10051005
    10061006    HRESULT rc = S_OK;
    10071007
    10081008    /* share parent weakly */
    1009     unconst (mVirtualBox) = aVirtualBox;
     1009    unconst(mVirtualBox) = aVirtualBox;
    10101010
    10111011    /* register with parent early, since uninit() will unconditionally
     
    10181018
    10191019    /* required */
    1020     unconst (m.id) = aImageNode.value <Guid> ("uuid");
     1020    unconst(m.id) = aImageNode.value <Guid> ("uuid");
    10211021    /* required */
    10221022    Bstr location = aImageNode.stringValue ("location");
    10231023    rc = setLocation (location);
    1024     CheckComRCReturnRC (rc);
     1024    CheckComRCReturnRC(rc);
    10251025    /* optional */
    10261026    {
     
    10301030    }
    10311031
    1032     LogFlowThisFunc (("m.locationFull='%ls', m.id={%RTuuid}\n",
     1032    LogFlowThisFunc(("m.locationFull='%ls', m.id={%RTuuid}\n",
    10331033                      m.locationFull.raw(), m.id.raw()));
    10341034
     
    10411041
    10421042    /* Confirm a successful initialization when it's the case */
    1043     if (SUCCEEDED (rc))
     1043    if (SUCCEEDED(rc))
    10441044        autoInitSpan.setSucceeded();
    10451045
     
    10541054void ImageMediumBase::protectedUninit()
    10551055{
    1056     LogFlowThisFunc (("\n"));
     1056    LogFlowThisFunc(("\n"));
    10571057
    10581058    /* Enclose the state transition Ready->InUninit->NotReady */
    1059     AutoUninitSpan autoUninitSpan (this);
     1059    AutoUninitSpan autoUninitSpan(this);
    10601060    if (autoUninitSpan.uninitDone())
    10611061        return;
     
    10631063    mVirtualBox->removeDependentChild (this);
    10641064
    1065     unconst (mVirtualBox).setNull();
     1065    unconst(mVirtualBox).setNull();
    10661066}
    10671067
     
    10811081    using namespace settings;
    10821082
    1083     AssertReturn (!aImagesNode.isNull(), E_FAIL);
    1084 
    1085     AutoCaller autoCaller (this);
    1086     CheckComRCReturnRC (autoCaller.rc());
    1087 
    1088     AutoReadLock alock (this);
     1083    AssertReturn(!aImagesNode.isNull(), E_FAIL);
     1084
     1085    AutoCaller autoCaller(this);
     1086    CheckComRCReturnRC(autoCaller.rc());
     1087
     1088    AutoReadLock alock(this);
    10891089
    10901090    Key imageNode = aImagesNode.appendKey ("Image");
  • trunk/src/VBox/Main/MouseImpl.cpp

    r21226 r21878  
    8080HRESULT Mouse::init (Console *parent)
    8181{
    82     LogFlowThisFunc (("\n"));
     82    LogFlowThisFunc(("\n"));
    8383
    8484    ComAssertRet (parent, E_INVALIDARG);
    8585
    8686    /* Enclose the state transition NotReady->InInit->Ready */
    87     AutoInitSpan autoInitSpan (this);
    88     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     87    AutoInitSpan autoInitSpan(this);
     88    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    8989
    9090    unconst(mParent) = parent;
     
    109109void Mouse::uninit()
    110110{
    111     LogFlowThisFunc (("\n"));
     111    LogFlowThisFunc(("\n"));
    112112
    113113    /* Enclose the state transition Ready->InUninit->NotReady */
    114     AutoUninitSpan autoUninitSpan (this);
     114    AutoUninitSpan autoUninitSpan(this);
    115115    if (autoUninitSpan.uninitDone())
    116116        return;
     
    120120    mpDrv = NULL;
    121121
    122     unconst (mParent).setNull();
     122    unconst(mParent).setNull();
    123123}
    124124
     
    138138        return E_POINTER;
    139139
    140     AutoCaller autoCaller (this);
    141     CheckComRCReturnRC (autoCaller.rc());
    142 
    143     AutoWriteLock alock (this);
     140    AutoCaller autoCaller(this);
     141    CheckComRCReturnRC(autoCaller.rc());
     142
     143    AutoWriteLock alock(this);
    144144
    145145    CHECK_CONSOLE_DRV (mpDrv);
     
    168168        return E_POINTER;
    169169
    170     AutoCaller autoCaller (this);
    171     CheckComRCReturnRC (autoCaller.rc());
    172 
    173     AutoWriteLock alock (this);
     170    AutoCaller autoCaller(this);
     171    CheckComRCReturnRC(autoCaller.rc());
     172
     173    AutoWriteLock alock(this);
    174174
    175175    CHECK_CONSOLE_DRV (mpDrv);
     
    202202    HRESULT rc = S_OK;
    203203
    204     AutoCaller autoCaller (this);
    205     CheckComRCReturnRC (autoCaller.rc());
    206 
    207     AutoWriteLock alock (this);
     204    AutoCaller autoCaller(this);
     205    CheckComRCReturnRC(autoCaller.rc());
     206
     207    AutoWriteLock alock(this);
    208208
    209209    CHECK_CONSOLE_DRV (mpDrv);
     
    236236
    237237    int vrc = mpDrv->pUpPort->pfnPutEvent(mpDrv->pUpPort, dx, dy, dz, fButtons);
    238     if (RT_FAILURE (vrc))
     238    if (RT_FAILURE(vrc))
    239239        rc = setError (VBOX_E_IPRT_ERROR,
    240240            tr ("Could not send the mouse event to the virtual mouse (%Rrc)"),
     
    259259    HRESULT rc = S_OK;
    260260
    261     AutoCaller autoCaller (this);
    262     CheckComRCReturnRC (autoCaller.rc());
    263 
    264     AutoWriteLock alock (this);
     261    AutoCaller autoCaller(this);
     262    CheckComRCReturnRC(autoCaller.rc());
     263
     264    AutoWriteLock alock(this);
    265265
    266266    CHECK_CONSOLE_DRV (mpDrv);
     
    332332        mLastAbsX = mouseXAbs;
    333333        mLastAbsY = mouseYAbs;
    334         if (RT_FAILURE (vrc))
     334        if (RT_FAILURE(vrc))
    335335            rc = setError (VBOX_E_IPRT_ERROR,
    336336                tr ("Could not send the mouse event to the virtual mouse (%Rrc)"),
  • trunk/src/VBox/Main/NetworkAdapterImpl.cpp

    r21817 r21878  
    5656HRESULT NetworkAdapter::init (Machine *aParent, ULONG aSlot)
    5757{
    58     LogFlowThisFunc (("aParent=%p, aSlot=%d\n", aParent, aSlot));
     58    LogFlowThisFunc(("aParent=%p, aSlot=%d\n", aParent, aSlot));
    5959
    6060    ComAssertRet (aParent, E_INVALIDARG);
     
    6262
    6363    /* Enclose the state transition NotReady->InInit->Ready */
    64     AutoInitSpan autoInitSpan (this);
    65     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    66 
    67     unconst (mParent) = aParent;
     64    AutoInitSpan autoInitSpan(this);
     65    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     66
     67    unconst(mParent) = aParent;
    6868    /* mPeer is left null */
    6969
     
    9999HRESULT NetworkAdapter::init (Machine *aParent, NetworkAdapter *aThat)
    100100{
    101     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     101    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    102102
    103103    ComAssertRet (aParent && aThat, E_INVALIDARG);
    104104
    105105    /* Enclose the state transition NotReady->InInit->Ready */
    106     AutoInitSpan autoInitSpan (this);
    107     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    108 
    109     unconst (mParent) = aParent;
    110     unconst (mPeer) = aThat;
     106    AutoInitSpan autoInitSpan(this);
     107    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     108
     109    unconst(mParent) = aParent;
     110    unconst(mPeer) = aThat;
    111111
    112112    AutoCaller thatCaller (aThat);
    113     AssertComRCReturnRC (thatCaller.rc());
     113    AssertComRCReturnRC(thatCaller.rc());
    114114
    115115    AutoReadLock thatLock (aThat);
     
    131131HRESULT NetworkAdapter::initCopy (Machine *aParent, NetworkAdapter *aThat)
    132132{
    133     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     133    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    134134
    135135    ComAssertRet (aParent && aThat, E_INVALIDARG);
    136136
    137137    /* Enclose the state transition NotReady->InInit->Ready */
    138     AutoInitSpan autoInitSpan (this);
    139     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    140 
    141     unconst (mParent) = aParent;
     138    AutoInitSpan autoInitSpan(this);
     139    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     140
     141    unconst(mParent) = aParent;
    142142    /* mPeer is left null */
    143143
    144144    AutoCaller thatCaller (aThat);
    145     AssertComRCReturnRC (thatCaller.rc());
     145    AssertComRCReturnRC(thatCaller.rc());
    146146
    147147    AutoReadLock thatLock (aThat);
     
    160160void NetworkAdapter::uninit()
    161161{
    162     LogFlowThisFunc (("\n"));
     162    LogFlowThisFunc(("\n"));
    163163
    164164    /* Enclose the state transition Ready->InUninit->NotReady */
    165     AutoUninitSpan autoUninitSpan (this);
     165    AutoUninitSpan autoUninitSpan(this);
    166166    if (autoUninitSpan.uninitDone())
    167167        return;
     
    169169    mData.free();
    170170
    171     unconst (mPeer).setNull();
    172     unconst (mParent).setNull();
     171    unconst(mPeer).setNull();
     172    unconst(mParent).setNull();
    173173}
    174174
     
    180180    CheckComArgOutPointerValid(aAdapterType);
    181181
    182     AutoCaller autoCaller (this);
    183     CheckComRCReturnRC (autoCaller.rc());
    184 
    185     AutoReadLock alock (this);
     182    AutoCaller autoCaller(this);
     183    CheckComRCReturnRC(autoCaller.rc());
     184
     185    AutoReadLock alock(this);
    186186
    187187    *aAdapterType = mData->mAdapterType;
     
    192192STDMETHODIMP NetworkAdapter::COMSETTER(AdapterType) (NetworkAdapterType_T aAdapterType)
    193193{
    194     AutoCaller autoCaller (this);
    195     CheckComRCReturnRC (autoCaller.rc());
    196 
    197     /* the machine needs to be mutable */
    198     Machine::AutoMutableStateDependency adep (mParent);
    199     CheckComRCReturnRC (adep.rc());
    200 
    201     AutoWriteLock alock (this);
     194    AutoCaller autoCaller(this);
     195    CheckComRCReturnRC(autoCaller.rc());
     196
     197    /* the machine needs to be mutable */
     198    Machine::AutoMutableStateDependency adep (mParent);
     199    CheckComRCReturnRC(adep.rc());
     200
     201    AutoWriteLock alock(this);
    202202
    203203    /* make sure the value is allowed */
     
    236236    CheckComArgOutPointerValid(aSlot);
    237237
    238     AutoCaller autoCaller (this);
    239     CheckComRCReturnRC (autoCaller.rc());
    240 
    241     AutoReadLock alock (this);
     238    AutoCaller autoCaller(this);
     239    CheckComRCReturnRC(autoCaller.rc());
     240
     241    AutoReadLock alock(this);
    242242
    243243    *aSlot = mData->mSlot;
     
    250250    CheckComArgOutPointerValid(aEnabled);
    251251
    252     AutoCaller autoCaller (this);
    253     CheckComRCReturnRC (autoCaller.rc());
    254 
    255     AutoReadLock alock (this);
     252    AutoCaller autoCaller(this);
     253    CheckComRCReturnRC(autoCaller.rc());
     254
     255    AutoReadLock alock(this);
    256256
    257257    *aEnabled = mData->mEnabled;
     
    262262STDMETHODIMP NetworkAdapter::COMSETTER(Enabled) (BOOL aEnabled)
    263263{
    264     AutoCaller autoCaller (this);
    265     CheckComRCReturnRC (autoCaller.rc());
    266 
    267     /* the machine needs to be mutable */
    268     Machine::AutoMutableStateDependency adep (mParent);
    269     CheckComRCReturnRC (adep.rc());
    270 
    271     AutoWriteLock alock (this);
     264    AutoCaller autoCaller(this);
     265    CheckComRCReturnRC(autoCaller.rc());
     266
     267    /* the machine needs to be mutable */
     268    Machine::AutoMutableStateDependency adep (mParent);
     269    CheckComRCReturnRC(adep.rc());
     270
     271    AutoWriteLock alock(this);
    272272
    273273    if (mData->mEnabled != aEnabled)
     
    289289    CheckComArgOutPointerValid(aMACAddress);
    290290
    291     AutoCaller autoCaller (this);
    292     CheckComRCReturnRC (autoCaller.rc());
    293 
    294     AutoReadLock alock (this);
     291    AutoCaller autoCaller(this);
     292    CheckComRCReturnRC(autoCaller.rc());
     293
     294    AutoReadLock alock(this);
    295295
    296296    ComAssertRet (!!mData->mMACAddress, E_FAIL);
    297297
    298     mData->mMACAddress.cloneTo (aMACAddress);
     298    mData->mMACAddress.cloneTo(aMACAddress);
    299299
    300300    return S_OK;
     
    303303STDMETHODIMP NetworkAdapter::COMSETTER(MACAddress)(IN_BSTR aMACAddress)
    304304{
    305     AutoCaller autoCaller (this);
    306     CheckComRCReturnRC (autoCaller.rc());
    307 
    308     /* the machine needs to be mutable */
    309     Machine::AutoMutableStateDependency adep (mParent);
    310     CheckComRCReturnRC (adep.rc());
    311 
    312     AutoWriteLock alock (this);
     305    AutoCaller autoCaller(this);
     306    CheckComRCReturnRC(autoCaller.rc());
     307
     308    /* the machine needs to be mutable */
     309    Machine::AutoMutableStateDependency adep (mParent);
     310    CheckComRCReturnRC(adep.rc());
     311
     312    AutoWriteLock alock(this);
    313313
    314314    HRESULT rc = S_OK;
     
    360360                rc = setError(E_INVALIDARG, tr("Invalid MAC address format"));
    361361
    362             if (SUCCEEDED (rc))
     362            if (SUCCEEDED(rc))
    363363            {
    364364                mData.backup();
     
    386386    CheckComArgOutPointerValid(aAttachmentType);
    387387
    388     AutoCaller autoCaller (this);
    389     CheckComRCReturnRC (autoCaller.rc());
    390 
    391     AutoReadLock alock (this);
     388    AutoCaller autoCaller(this);
     389    CheckComRCReturnRC(autoCaller.rc());
     390
     391    AutoReadLock alock(this);
    392392
    393393    *aAttachmentType = mData->mAttachmentType;
     
    400400    CheckComArgOutPointerValid(aHostInterface);
    401401
    402     AutoCaller autoCaller (this);
    403     CheckComRCReturnRC (autoCaller.rc());
    404 
    405     AutoReadLock alock (this);
    406 
    407     mData->mHostInterface.cloneTo (aHostInterface);
     402    AutoCaller autoCaller(this);
     403    CheckComRCReturnRC(autoCaller.rc());
     404
     405    AutoReadLock alock(this);
     406
     407    mData->mHostInterface.cloneTo(aHostInterface);
    408408
    409409    return S_OK;
     
    418418    CheckComArgNotNull (aHostInterface);
    419419
    420     AutoCaller autoCaller (this);
    421     CheckComRCReturnRC (autoCaller.rc());
    422 
    423     /* the machine needs to be mutable */
    424     Machine::AutoMutableStateDependency adep (mParent);
    425     CheckComRCReturnRC (adep.rc());
    426 
    427     AutoWriteLock alock (this);
     420    AutoCaller autoCaller(this);
     421    CheckComRCReturnRC(autoCaller.rc());
     422
     423    /* the machine needs to be mutable */
     424    Machine::AutoMutableStateDependency adep (mParent);
     425    CheckComRCReturnRC(adep.rc());
     426
     427    AutoWriteLock alock(this);
    428428
    429429    if (mData->mHostInterface != aHostInterface)
     
    445445    CheckComArgOutPointerValid(aInternalNetwork);
    446446
    447     AutoCaller autoCaller (this);
    448     CheckComRCReturnRC (autoCaller.rc());
    449 
    450     AutoReadLock alock (this);
    451 
    452     mData->mInternalNetwork.cloneTo (aInternalNetwork);
     447    AutoCaller autoCaller(this);
     448    CheckComRCReturnRC(autoCaller.rc());
     449
     450    AutoReadLock alock(this);
     451
     452    mData->mInternalNetwork.cloneTo(aInternalNetwork);
    453453
    454454    return S_OK;
     
    457457STDMETHODIMP NetworkAdapter::COMSETTER(InternalNetwork) (IN_BSTR aInternalNetwork)
    458458{
    459     AutoCaller autoCaller (this);
    460     CheckComRCReturnRC (autoCaller.rc());
    461 
    462     /* the machine needs to be mutable */
    463     Machine::AutoMutableStateDependency adep (mParent);
    464     CheckComRCReturnRC (adep.rc());
    465 
    466     AutoWriteLock alock (this);
     459    AutoCaller autoCaller(this);
     460    CheckComRCReturnRC(autoCaller.rc());
     461
     462    /* the machine needs to be mutable */
     463    Machine::AutoMutableStateDependency adep (mParent);
     464    CheckComRCReturnRC(adep.rc());
     465
     466    AutoWriteLock alock(this);
    467467
    468468    if (mData->mInternalNetwork != aInternalNetwork)
     
    493493    CheckComArgOutPointerValid(aNATNetwork);
    494494
    495     AutoCaller autoCaller (this);
    496     CheckComRCReturnRC (autoCaller.rc());
    497 
    498     AutoReadLock alock (this);
    499 
    500     mData->mNATNetwork.cloneTo (aNATNetwork);
     495    AutoCaller autoCaller(this);
     496    CheckComRCReturnRC(autoCaller.rc());
     497
     498    AutoReadLock alock(this);
     499
     500    mData->mNATNetwork.cloneTo(aNATNetwork);
    501501
    502502    return S_OK;
     
    505505STDMETHODIMP NetworkAdapter::COMSETTER(NATNetwork) (IN_BSTR aNATNetwork)
    506506{
    507     AutoCaller autoCaller (this);
    508     CheckComRCReturnRC (autoCaller.rc());
    509 
    510     /* the machine needs to be mutable */
    511     Machine::AutoMutableStateDependency adep (mParent);
    512     CheckComRCReturnRC (adep.rc());
    513 
    514     AutoWriteLock alock (this);
     507    AutoCaller autoCaller(this);
     508    CheckComRCReturnRC(autoCaller.rc());
     509
     510    /* the machine needs to be mutable */
     511    Machine::AutoMutableStateDependency adep (mParent);
     512    CheckComRCReturnRC(adep.rc());
     513
     514    AutoWriteLock alock(this);
    515515
    516516    if (mData->mNATNetwork != aNATNetwork)
     
    532532    CheckComArgOutPointerValid(aConnected);
    533533
    534     AutoCaller autoCaller (this);
    535     CheckComRCReturnRC (autoCaller.rc());
    536 
    537     AutoReadLock alock (this);
     534    AutoCaller autoCaller(this);
     535    CheckComRCReturnRC(autoCaller.rc());
     536
     537    AutoReadLock alock(this);
    538538
    539539    *aConnected = mData->mCableConnected;
     
    544544STDMETHODIMP NetworkAdapter::COMSETTER(CableConnected) (BOOL aConnected)
    545545{
    546     AutoCaller autoCaller (this);
    547     CheckComRCReturnRC (autoCaller.rc());
    548 
    549     /* the machine needs to be mutable */
    550     Machine::AutoMutableStateDependency adep (mParent);
    551     CheckComRCReturnRC (adep.rc());
    552 
    553     AutoWriteLock alock (this);
     546    AutoCaller autoCaller(this);
     547    CheckComRCReturnRC(autoCaller.rc());
     548
     549    /* the machine needs to be mutable */
     550    Machine::AutoMutableStateDependency adep (mParent);
     551    CheckComRCReturnRC(adep.rc());
     552
     553    AutoWriteLock alock(this);
    554554
    555555    if (aConnected != mData->mCableConnected)
     
    571571    CheckComArgOutPointerValid(aSpeed);
    572572
    573     AutoCaller autoCaller (this);
    574     CheckComRCReturnRC (autoCaller.rc());
    575 
    576     AutoReadLock alock (this);
     573    AutoCaller autoCaller(this);
     574    CheckComRCReturnRC(autoCaller.rc());
     575
     576    AutoReadLock alock(this);
    577577
    578578    *aSpeed = mData->mLineSpeed;
     
    583583STDMETHODIMP NetworkAdapter::COMSETTER(LineSpeed) (ULONG aSpeed)
    584584{
    585     AutoCaller autoCaller (this);
    586     CheckComRCReturnRC (autoCaller.rc());
    587 
    588     /* the machine needs to be mutable */
    589     Machine::AutoMutableStateDependency adep (mParent);
    590     CheckComRCReturnRC (adep.rc());
    591 
    592     AutoWriteLock alock (this);
     585    AutoCaller autoCaller(this);
     586    CheckComRCReturnRC(autoCaller.rc());
     587
     588    /* the machine needs to be mutable */
     589    Machine::AutoMutableStateDependency adep (mParent);
     590    CheckComRCReturnRC(adep.rc());
     591
     592    AutoWriteLock alock(this);
    593593
    594594    if (aSpeed != mData->mLineSpeed)
     
    610610    CheckComArgOutPointerValid(aEnabled);
    611611
    612     AutoCaller autoCaller (this);
    613     CheckComRCReturnRC (autoCaller.rc());
    614 
    615     AutoReadLock alock (this);
     612    AutoCaller autoCaller(this);
     613    CheckComRCReturnRC(autoCaller.rc());
     614
     615    AutoReadLock alock(this);
    616616
    617617    *aEnabled = mData->mTraceEnabled;
     
    621621STDMETHODIMP NetworkAdapter::COMSETTER(TraceEnabled) (BOOL aEnabled)
    622622{
    623     AutoCaller autoCaller (this);
    624     CheckComRCReturnRC (autoCaller.rc());
    625 
    626     /* the machine needs to be mutable */
    627     Machine::AutoMutableStateDependency adep (mParent);
    628     CheckComRCReturnRC (adep.rc());
    629 
    630     AutoWriteLock alock (this);
     623    AutoCaller autoCaller(this);
     624    CheckComRCReturnRC(autoCaller.rc());
     625
     626    /* the machine needs to be mutable */
     627    Machine::AutoMutableStateDependency adep (mParent);
     628    CheckComRCReturnRC(adep.rc());
     629
     630    AutoWriteLock alock(this);
    631631
    632632    if (aEnabled != mData->mTraceEnabled)
     
    648648    CheckComArgOutPointerValid(aTraceFile);
    649649
    650     AutoCaller autoCaller (this);
    651     CheckComRCReturnRC (autoCaller.rc());
    652 
    653     AutoReadLock alock (this);
    654 
    655     mData->mTraceFile.cloneTo (aTraceFile);
     650    AutoCaller autoCaller(this);
     651    CheckComRCReturnRC(autoCaller.rc());
     652
     653    AutoReadLock alock(this);
     654
     655    mData->mTraceFile.cloneTo(aTraceFile);
    656656
    657657    return S_OK;
     
    660660STDMETHODIMP NetworkAdapter::COMSETTER(TraceFile) (IN_BSTR aTraceFile)
    661661{
    662     AutoCaller autoCaller (this);
    663     CheckComRCReturnRC (autoCaller.rc());
    664 
    665     /* the machine needs to be mutable */
    666     Machine::AutoMutableStateDependency adep (mParent);
    667     CheckComRCReturnRC (adep.rc());
    668 
    669     AutoWriteLock alock (this);
     662    AutoCaller autoCaller(this);
     663    CheckComRCReturnRC(autoCaller.rc());
     664
     665    /* the machine needs to be mutable */
     666    Machine::AutoMutableStateDependency adep (mParent);
     667    CheckComRCReturnRC(adep.rc());
     668
     669    AutoWriteLock alock(this);
    670670
    671671    if (mData->mTraceFile != aTraceFile)
     
    688688STDMETHODIMP NetworkAdapter::AttachToNAT()
    689689{
    690     AutoCaller autoCaller (this);
    691     CheckComRCReturnRC (autoCaller.rc());
    692 
    693     /* the machine needs to be mutable */
    694     Machine::AutoMutableStateDependency adep (mParent);
    695     CheckComRCReturnRC (adep.rc());
    696 
    697     AutoWriteLock alock (this);
     690    AutoCaller autoCaller(this);
     691    CheckComRCReturnRC(autoCaller.rc());
     692
     693    /* the machine needs to be mutable */
     694    Machine::AutoMutableStateDependency adep (mParent);
     695    CheckComRCReturnRC(adep.rc());
     696
     697    AutoWriteLock alock(this);
    698698
    699699    if (mData->mAttachmentType != NetworkAttachmentType_NAT)
     
    718718STDMETHODIMP NetworkAdapter::AttachToBridgedInterface()
    719719{
    720     AutoCaller autoCaller (this);
    721     CheckComRCReturnRC (autoCaller.rc());
    722 
    723     /* the machine needs to be mutable */
    724     Machine::AutoMutableStateDependency adep (mParent);
    725     CheckComRCReturnRC (adep.rc());
    726 
    727     AutoWriteLock alock (this);
     720    AutoCaller autoCaller(this);
     721    CheckComRCReturnRC(autoCaller.rc());
     722
     723    /* the machine needs to be mutable */
     724    Machine::AutoMutableStateDependency adep (mParent);
     725    CheckComRCReturnRC(adep.rc());
     726
     727    AutoWriteLock alock(this);
    728728
    729729    /* don't do anything if we're already host interface attached */
     
    750750STDMETHODIMP NetworkAdapter::AttachToInternalNetwork()
    751751{
    752     AutoCaller autoCaller (this);
    753     CheckComRCReturnRC (autoCaller.rc());
    754 
    755     /* the machine needs to be mutable */
    756     Machine::AutoMutableStateDependency adep (mParent);
    757     CheckComRCReturnRC (adep.rc());
    758 
    759     AutoWriteLock alock (this);
     752    AutoCaller autoCaller(this);
     753    CheckComRCReturnRC(autoCaller.rc());
     754
     755    /* the machine needs to be mutable */
     756    Machine::AutoMutableStateDependency adep (mParent);
     757    CheckComRCReturnRC(adep.rc());
     758
     759    AutoWriteLock alock(this);
    760760
    761761    /* don't do anything if we're already internal network attached */
     
    790790STDMETHODIMP NetworkAdapter::AttachToHostOnlyInterface()
    791791{
    792     AutoCaller autoCaller (this);
    793     CheckComRCReturnRC (autoCaller.rc());
    794 
    795     /* the machine needs to be mutable */
    796     Machine::AutoMutableStateDependency adep (mParent);
    797     CheckComRCReturnRC (adep.rc());
    798 
    799     AutoWriteLock alock (this);
     792    AutoCaller autoCaller(this);
     793    CheckComRCReturnRC(autoCaller.rc());
     794
     795    /* the machine needs to be mutable */
     796    Machine::AutoMutableStateDependency adep (mParent);
     797    CheckComRCReturnRC(adep.rc());
     798
     799    AutoWriteLock alock(this);
    800800
    801801    /* don't do anything if we're already host interface attached */
     
    822822STDMETHODIMP NetworkAdapter::Detach()
    823823{
    824     AutoCaller autoCaller (this);
    825     CheckComRCReturnRC (autoCaller.rc());
    826 
    827     /* the machine needs to be mutable */
    828     Machine::AutoMutableStateDependency adep (mParent);
    829     CheckComRCReturnRC (adep.rc());
    830 
    831     AutoWriteLock alock (this);
     824    AutoCaller autoCaller(this);
     825    CheckComRCReturnRC(autoCaller.rc());
     826
     827    /* the machine needs to be mutable */
     828    Machine::AutoMutableStateDependency adep (mParent);
     829    CheckComRCReturnRC(adep.rc());
     830
     831    AutoWriteLock alock(this);
    832832
    833833    if (mData->mAttachmentType != NetworkAttachmentType_Null)
     
    861861    using namespace settings;
    862862
    863     AssertReturn (!aAdapterNode.isNull(), E_FAIL);
    864 
    865     AutoCaller autoCaller (this);
    866     AssertComRCReturnRC (autoCaller.rc());
    867 
    868     AutoWriteLock alock (this);
     863    AssertReturn(!aAdapterNode.isNull(), E_FAIL);
     864
     865    AutoCaller autoCaller(this);
     866    AssertComRCReturnRC(autoCaller.rc());
     867
     868    AutoWriteLock alock(this);
    869869
    870870    /* Note: we assume that the default values for attributes of optional
     
    902902    /* MAC address (can be null) */
    903903    rc = COMSETTER(MACAddress) (Bstr (aAdapterNode.stringValue ("MACAddress")));
    904     CheckComRCReturnRC (rc);
     904    CheckComRCReturnRC(rc);
    905905    /* cable (required) */
    906906    mData->mCableConnected = aAdapterNode.value <bool> ("cable");
     
    922922
    923923        rc = AttachToNAT();
    924         CheckComRCReturnRC (rc);
     924        CheckComRCReturnRC(rc);
    925925    }
    926926    else
     
    935935
    936936        rc = COMSETTER(HostInterface) (name);
    937         CheckComRCReturnRC (rc);
     937        CheckComRCReturnRC(rc);
    938938
    939939        rc = AttachToBridgedInterface();
    940         CheckComRCReturnRC (rc);
     940        CheckComRCReturnRC(rc);
    941941    }
    942942    else
     
    950950
    951951        rc = AttachToInternalNetwork();
    952         CheckComRCReturnRC (rc);
     952        CheckComRCReturnRC(rc);
    953953    }
    954954    else
     
    961961
    962962        rc = COMSETTER(HostInterface) (name);
    963         CheckComRCReturnRC (rc);
     963        CheckComRCReturnRC(rc);
    964964#endif
    965965
    966966        /* Host Interface Networking */
    967967        rc = AttachToHostOnlyInterface();
    968         CheckComRCReturnRC (rc);
     968        CheckComRCReturnRC(rc);
    969969    }
    970970    else
     
    972972        /* Adapter has no children */
    973973        rc = Detach();
    974         CheckComRCReturnRC (rc);
     974        CheckComRCReturnRC(rc);
    975975    }
    976976
     
    991991    using namespace settings;
    992992
    993     AssertReturn (!aAdapterNode.isNull(), E_FAIL);
    994 
    995     AutoCaller autoCaller (this);
    996     AssertComRCReturnRC (autoCaller.rc());
    997 
    998     AutoReadLock alock (this);
     993    AssertReturn(!aAdapterNode.isNull(), E_FAIL);
     994
     995    AutoCaller autoCaller(this);
     996    AssertComRCReturnRC(autoCaller.rc());
     997
     998    AutoReadLock alock(this);
    999999
    10001000    aAdapterNode.setValue <bool> ("enabled", !!mData->mEnabled);
     
    10871087{
    10881088    /* sanity */
    1089     AutoCaller autoCaller (this);
     1089    AutoCaller autoCaller(this);
    10901090    AssertComRCReturn (autoCaller.rc(), false);
    10911091
    1092     AutoWriteLock alock (this);
     1092    AutoWriteLock alock(this);
    10931093
    10941094    bool changed = false;
     
    11121112{
    11131113    /* sanity */
    1114     AutoCaller autoCaller (this);
     1114    AutoCaller autoCaller(this);
    11151115    AssertComRCReturnVoid (autoCaller.rc());
    11161116
     
    11431143
    11441144    /* sanity */
    1145     AutoCaller autoCaller (this);
     1145    AutoCaller autoCaller(this);
    11461146    AssertComRCReturnVoid (autoCaller.rc());
    11471147
     
    11631163
    11641164    /* sanity */
    1165     AutoCaller autoCaller (this);
     1165    AutoCaller autoCaller(this);
    11661166    AssertComRCReturnVoid (autoCaller.rc());
    11671167
    1168     AutoWriteLock alock (this);
     1168    AutoWriteLock alock(this);
    11691169
    11701170    bool e1000enabled = false;
     
    12591259    RTStrPrintf (strMAC, sizeof(strMAC), "080027%02X%02X%02X",
    12601260                 guid.ptr()->au8[0], guid.ptr()->au8[1], guid.ptr()->au8[2]);
    1261     LogFlowThisFunc (("generated MAC: '%s'\n", strMAC));
     1261    LogFlowThisFunc(("generated MAC: '%s'\n", strMAC));
    12621262    mData->mMACAddress = strMAC;
    12631263}
  • trunk/src/VBox/Main/ParallelPortImpl.cpp

    r16560 r21878  
    5555HRESULT ParallelPort::init (Machine *aParent, ULONG aSlot)
    5656{
    57     LogFlowThisFunc (("aParent=%p, aSlot=%d\n", aParent, aSlot));
     57    LogFlowThisFunc(("aParent=%p, aSlot=%d\n", aParent, aSlot));
    5858
    5959    ComAssertRet (aParent, E_INVALIDARG);
    6060
    6161    /* Enclose the state transition NotReady->InInit->Ready */
    62     AutoInitSpan autoInitSpan (this);
    63     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    64 
    65     unconst (mParent) = aParent;
     62    AutoInitSpan autoInitSpan(this);
     63    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     64
     65    unconst(mParent) = aParent;
    6666    /* mPeer is left null */
    6767
     
    8989HRESULT ParallelPort::init (Machine *aParent, ParallelPort *aThat)
    9090{
    91     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     91    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    9292
    9393    ComAssertRet (aParent && aThat, E_INVALIDARG);
    9494
    9595    /* Enclose the state transition NotReady->InInit->Ready */
    96     AutoInitSpan autoInitSpan (this);
    97     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    98 
    99     unconst (mParent) = aParent;
    100     unconst (mPeer) = aThat;
     96    AutoInitSpan autoInitSpan(this);
     97    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     98
     99    unconst(mParent) = aParent;
     100    unconst(mPeer) = aThat;
    101101
    102102    AutoCaller thatCaller (aThat);
    103     AssertComRCReturnRC (thatCaller.rc());
     103    AssertComRCReturnRC(thatCaller.rc());
    104104
    105105    AutoReadLock thatLock (aThat);
     
    121121HRESULT ParallelPort::initCopy (Machine *aParent, ParallelPort *aThat)
    122122{
    123     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     123    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    124124
    125125    ComAssertRet (aParent && aThat, E_INVALIDARG);
    126126
    127127    /* Enclose the state transition NotReady->InInit->Ready */
    128     AutoInitSpan autoInitSpan (this);
    129     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    130 
    131     unconst (mParent) = aParent;
     128    AutoInitSpan autoInitSpan(this);
     129    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     130
     131    unconst(mParent) = aParent;
    132132    /* mPeer is left null */
    133133
    134134    AutoCaller thatCaller (aThat);
    135     AssertComRCReturnRC (thatCaller.rc());
     135    AssertComRCReturnRC(thatCaller.rc());
    136136
    137137    AutoReadLock thatLock (aThat);
     
    150150void ParallelPort::uninit()
    151151{
    152     LogFlowThisFunc (("\n"));
     152    LogFlowThisFunc(("\n"));
    153153
    154154    /* Enclose the state transition Ready->InUninit->NotReady */
    155     AutoUninitSpan autoUninitSpan (this);
     155    AutoUninitSpan autoUninitSpan(this);
    156156    if (autoUninitSpan.uninitDone())
    157157        return;
     
    159159    mData.free();
    160160
    161     unconst (mPeer).setNull();
    162     unconst (mParent).setNull();
     161    unconst(mPeer).setNull();
     162    unconst(mParent).setNull();
    163163}
    164164
     
    178178    using namespace settings;
    179179
    180     AssertReturn (!aPortNode.isNull(), E_FAIL);
    181 
    182     AutoCaller autoCaller (this);
    183     AssertComRCReturnRC (autoCaller.rc());
    184 
    185     AutoWriteLock alock (this);
     180    AssertReturn(!aPortNode.isNull(), E_FAIL);
     181
     182    AutoCaller autoCaller(this);
     183    AssertComRCReturnRC(autoCaller.rc());
     184
     185    AutoWriteLock alock(this);
    186186
    187187    /* Note: we assume that the default values for attributes of optional
     
    206206
    207207    HRESULT rc = checkSetPath (path);
    208     CheckComRCReturnRC (rc);
     208    CheckComRCReturnRC(rc);
    209209    mData->mPath = path;
    210210
     
    225225    using namespace settings;
    226226
    227     AssertReturn (!aPortNode.isNull(), E_FAIL);
    228 
    229     AutoCaller autoCaller (this);
    230     AssertComRCReturnRC (autoCaller.rc());
    231 
    232     AutoReadLock alock (this);
     227    AssertReturn(!aPortNode.isNull(), E_FAIL);
     228
     229    AutoCaller autoCaller(this);
     230    AssertComRCReturnRC(autoCaller.rc());
     231
     232    AutoReadLock alock(this);
    233233
    234234    aPortNode.setValue <bool> ("enabled", !!mData->mEnabled);
     
    249249{
    250250    /* sanity */
    251     AutoCaller autoCaller (this);
     251    AutoCaller autoCaller(this);
    252252    AssertComRCReturn (autoCaller.rc(), false);
    253253
    254     AutoWriteLock alock (this);
     254    AutoWriteLock alock(this);
    255255
    256256    bool changed = false;
     
    274274{
    275275    /* sanity */
    276     AutoCaller autoCaller (this);
     276    AutoCaller autoCaller(this);
    277277    AssertComRCReturnVoid (autoCaller.rc());
    278278
     
    305305
    306306    /* sanity */
    307     AutoCaller autoCaller (this);
     307    AutoCaller autoCaller(this);
    308308    AssertComRCReturnVoid (autoCaller.rc());
    309309
     
    327327    CheckComArgOutPointerValid(aEnabled);
    328328
    329     AutoCaller autoCaller (this);
    330     CheckComRCReturnRC (autoCaller.rc());
    331 
    332     AutoReadLock alock (this);
     329    AutoCaller autoCaller(this);
     330    CheckComRCReturnRC(autoCaller.rc());
     331
     332    AutoReadLock alock(this);
    333333
    334334    *aEnabled = mData->mEnabled;
     
    339339STDMETHODIMP ParallelPort::COMSETTER(Enabled) (BOOL aEnabled)
    340340{
    341     LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
    342 
    343     AutoCaller autoCaller (this);
    344     CheckComRCReturnRC (autoCaller.rc());
     341    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     342
     343    AutoCaller autoCaller(this);
     344    CheckComRCReturnRC(autoCaller.rc());
    345345
    346346    /* the machine needs to be mutable */
    347347    Machine::AutoMutableStateDependency adep (mParent);
    348     CheckComRCReturnRC (adep.rc());
    349 
    350     AutoWriteLock alock (this);
     348    CheckComRCReturnRC(adep.rc());
     349
     350    AutoWriteLock alock(this);
    351351
    352352    if (mData->mEnabled != aEnabled)
     
    375375    CheckComArgOutPointerValid(aSlot);
    376376
    377     AutoCaller autoCaller (this);
    378     CheckComRCReturnRC (autoCaller.rc());
    379 
    380     AutoReadLock alock (this);
     377    AutoCaller autoCaller(this);
     378    CheckComRCReturnRC(autoCaller.rc());
     379
     380    AutoReadLock alock(this);
    381381
    382382    *aSlot = mData->mSlot;
     
    389389    CheckComArgOutPointerValid(aIRQ);
    390390
    391     AutoCaller autoCaller (this);
    392     CheckComRCReturnRC (autoCaller.rc());
    393 
    394     AutoReadLock alock (this);
     391    AutoCaller autoCaller(this);
     392    CheckComRCReturnRC(autoCaller.rc());
     393
     394    AutoReadLock alock(this);
    395395
    396396    *aIRQ = mData->mIRQ;
     
    409409            mData->mSlot, aIRQ, 255);
    410410
    411     AutoCaller autoCaller (this);
    412     CheckComRCReturnRC (autoCaller.rc());
     411    AutoCaller autoCaller(this);
     412    CheckComRCReturnRC(autoCaller.rc());
    413413
    414414    /* the machine needs to be mutable */
    415415    Machine::AutoMutableStateDependency adep (mParent);
    416     CheckComRCReturnRC (adep.rc());
    417 
    418     AutoWriteLock alock (this);
     416    CheckComRCReturnRC(adep.rc());
     417
     418    AutoWriteLock alock(this);
    419419
    420420    HRESULT rc = S_OK;
     
    443443    CheckComArgOutPointerValid(aIOBase);
    444444
    445     AutoCaller autoCaller (this);
    446     CheckComRCReturnRC (autoCaller.rc());
    447 
    448     AutoReadLock alock (this);
     445    AutoCaller autoCaller(this);
     446    CheckComRCReturnRC(autoCaller.rc());
     447
     448    AutoReadLock alock(this);
    449449
    450450    *aIOBase = mData->mIOBase;
     
    463463            mData->mSlot, aIOBase, 0, 0xFFFF);
    464464
    465     AutoCaller autoCaller (this);
    466     CheckComRCReturnRC (autoCaller.rc());
     465    AutoCaller autoCaller(this);
     466    CheckComRCReturnRC(autoCaller.rc());
    467467
    468468    /* the machine needs to be mutable */
    469469    Machine::AutoMutableStateDependency adep (mParent);
    470     CheckComRCReturnRC (adep.rc());
    471 
    472     AutoWriteLock alock (this);
     470    CheckComRCReturnRC(adep.rc());
     471
     472    AutoWriteLock alock(this);
    473473
    474474    HRESULT rc = S_OK;
     
    497497    CheckComArgOutPointerValid(aPath);
    498498
    499     AutoCaller autoCaller (this);
    500     CheckComRCReturnRC (autoCaller.rc());
    501 
    502     AutoReadLock alock (this);
    503 
    504     mData->mPath.cloneTo (aPath);
     499    AutoCaller autoCaller(this);
     500    CheckComRCReturnRC(autoCaller.rc());
     501
     502    AutoReadLock alock(this);
     503
     504    mData->mPath.cloneTo(aPath);
    505505
    506506    return S_OK;
     
    512512HRESULT ParallelPort::checkSetPath (CBSTR aPath)
    513513{
    514     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     514    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    515515
    516516    if (mData->mEnabled &&
     
    526526STDMETHODIMP ParallelPort::COMSETTER(Path) (IN_BSTR aPath)
    527527{
    528     AutoCaller autoCaller (this);
    529     CheckComRCReturnRC (autoCaller.rc());
     528    AutoCaller autoCaller(this);
     529    CheckComRCReturnRC(autoCaller.rc());
    530530
    531531    /* the machine needs to be mutable */
    532532    Machine::AutoMutableStateDependency adep (mParent);
    533     CheckComRCReturnRC (adep.rc());
    534 
    535     AutoWriteLock alock (this);
     533    CheckComRCReturnRC(adep.rc());
     534
     535    AutoWriteLock alock(this);
    536536
    537537    /* we treat empty as null when e.g. saving to XML, do the same here */
     
    542542    {
    543543        HRESULT rc = checkSetPath (aPath);
    544         CheckComRCReturnRC (rc);
     544        CheckComRCReturnRC(rc);
    545545
    546546        mData.backup();
  • trunk/src/VBox/Main/Performance.cpp

    r17911 r21878  
    118118/*bool BaseMetric::associatedWith(ComPtr<IUnknown> object)
    119119{
    120     LogFlowThisFunc (("mObject(%p) == object(%p) is %s.\n", mObject, object, mObject == object ? "true" : "false"));
     120    LogFlowThisFunc(("mObject(%p) == object(%p) is %s.\n", mObject, object, mObject == object ? "true" : "false"));
    121121    return mObject == object;
    122122}*/
     
    164164        {
    165165            /* This is only possible if none of counters has changed! */
    166             LogFlowThisFunc (("Impossible! User, kernel and idle raw "
     166            LogFlowThisFunc(("Impossible! User, kernel and idle raw "
    167167                "counters has not changed since last sample.\n" ));
    168168            mUser->put(0);
     
    432432    if (ComSafeArrayInIsNull(metricNames))
    433433    {
    434         com::SafeArray <BSTR> nameArray;
     434        com::SafeArray<BSTR> nameArray;
    435435        if (ComSafeArrayInIsNull(objects))
    436436        {
    437             com::SafeIfaceArray <IUnknown> objectArray;
     437            com::SafeIfaceArray<IUnknown> objectArray;
    438438            objectArray.reset(0);
    439439            init(ComSafeArrayAsInParam(nameArray),
     
    442442        else
    443443        {
    444             com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects));
     444            com::SafeIfaceArray<IUnknown> objectArray(ComSafeArrayInArg(objects));
    445445            init(ComSafeArrayAsInParam(nameArray),
    446446                 ComSafeArrayAsInParam(objectArray));
     
    449449    else
    450450    {
    451         com::SafeArray <IN_BSTR> nameArray(ComSafeArrayInArg(metricNames));
     451        com::SafeArray<IN_BSTR> nameArray(ComSafeArrayInArg(metricNames));
    452452        if (ComSafeArrayInIsNull(objects))
    453453        {
    454             com::SafeIfaceArray <IUnknown> objectArray;
     454            com::SafeIfaceArray<IUnknown> objectArray;
    455455            objectArray.reset(0);
    456456            init(ComSafeArrayAsInParam(nameArray),
     
    459459        else
    460460        {
    461             com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects));
     461            com::SafeIfaceArray<IUnknown> objectArray(ComSafeArrayInArg(objects));
    462462            init(ComSafeArrayAsInParam(nameArray),
    463463                 ComSafeArrayAsInParam(objectArray));
     
    469469                  ComSafeArrayIn(IUnknown *, objects))
    470470{
    471     com::SafeArray <IN_BSTR> nameArray(ComSafeArrayInArg(metricNames));
    472     com::SafeIfaceArray <IUnknown> objectArray(ComSafeArrayInArg(objects));
     471    com::SafeArray<IN_BSTR> nameArray(ComSafeArrayInArg(metricNames));
     472    com::SafeIfaceArray<IUnknown> objectArray(ComSafeArrayInArg(objects));
    473473
    474474    if (!objectArray.size())
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r21395 r21878  
    8282HRESULT PerformanceCollector::FinalConstruct()
    8383{
    84     LogFlowThisFunc (("\n"));
     84    LogFlowThisFunc(("\n"));
    8585
    8686    return S_OK;
     
    8989void PerformanceCollector::FinalRelease()
    9090{
    91     LogFlowThisFunc (("\n"));
     91    LogFlowThisFunc(("\n"));
    9292}
    9393
     
    101101{
    102102    /* Enclose the state transition NotReady->InInit->Ready */
    103     AutoInitSpan autoInitSpan (this);
    104     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     103    AutoInitSpan autoInitSpan(this);
     104    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    105105
    106106    LogFlowThisFuncEnter();
     
    118118    AssertMsgRC (vrc, ("Failed to create resource usage "
    119119                       "sampling timer(%Rra)\n", vrc));
    120     if (RT_FAILURE (vrc))
     120    if (RT_FAILURE(vrc))
    121121        rc = E_FAIL;
    122122
    123     if (SUCCEEDED (rc))
     123    if (SUCCEEDED(rc))
    124124        autoInitSpan.setSucceeded();
    125125
     
    139139
    140140    /* Enclose the state transition Ready->InUninit->NotReady */
    141     AutoUninitSpan autoUninitSpan (this);
     141    AutoUninitSpan autoUninitSpan(this);
    142142    if (autoUninitSpan.uninitDone())
    143143    {
    144         LogFlowThisFunc (("Already uninitialized.\n"));
     144        LogFlowThisFunc(("Already uninitialized.\n"));
    145145        LogFlowThisFuncLeave();
    146146        return;
     
    168168
    169169STDMETHODIMP
    170 PerformanceCollector::COMGETTER(MetricNames) (ComSafeArrayOut (BSTR, theMetricNames))
    171 {
    172     if (ComSafeArrayOutIsNull (theMetricNames))
     170PerformanceCollector::COMGETTER(MetricNames) (ComSafeArrayOut(BSTR, theMetricNames))
     171{
     172    if (ComSafeArrayOutIsNull(theMetricNames))
    173173        return E_POINTER;
    174174
    175     AutoCaller autoCaller (this);
    176     CheckComRCReturnRC (autoCaller.rc());
    177 
    178     AutoReadLock alock (this);
    179 
    180     com::SafeArray <BSTR> metricNames(RT_ELEMENTS(gMetricNames));
     175    AutoCaller autoCaller(this);
     176    CheckComRCReturnRC(autoCaller.rc());
     177
     178    AutoReadLock alock(this);
     179
     180    com::SafeArray<BSTR> metricNames(RT_ELEMENTS(gMetricNames));
    181181    for (size_t i = 0; i < RT_ELEMENTS(gMetricNames); i++)
    182182    {
    183183        Bstr(gMetricNames[i]).cloneTo(&metricNames[i]);
    184184    }
    185     //gMetricNames.detachTo(ComSafeArrayOutArg (theMetricNames));
    186     metricNames.detachTo (ComSafeArrayOutArg (theMetricNames));
     185    //gMetricNames.detachTo(ComSafeArrayOutArg(theMetricNames));
     186    metricNames.detachTo(ComSafeArrayOutArg(theMetricNames));
    187187
    188188    return S_OK;
     
    194194HRESULT PerformanceCollector::toIPerformanceMetric(pm::Metric *src, IPerformanceMetric **dst)
    195195{
    196     ComObjPtr <PerformanceMetric> metric;
     196    ComObjPtr<PerformanceMetric> metric;
    197197    HRESULT rc = metric.createObject();
    198     if (SUCCEEDED (rc))
     198    if (SUCCEEDED(rc))
    199199        rc = metric->init (src);
    200     AssertComRCReturnRC (rc);
    201     metric.queryInterfaceTo (dst);
     200    AssertComRCReturnRC(rc);
     201    metric.queryInterfaceTo(dst);
    202202    return rc;
    203203}
     
    205205HRESULT PerformanceCollector::toIPerformanceMetric(pm::BaseMetric *src, IPerformanceMetric **dst)
    206206{
    207     ComObjPtr <PerformanceMetric> metric;
     207    ComObjPtr<PerformanceMetric> metric;
    208208    HRESULT rc = metric.createObject();
    209     if (SUCCEEDED (rc))
     209    if (SUCCEEDED(rc))
    210210        rc = metric->init (src);
    211     AssertComRCReturnRC (rc);
    212     metric.queryInterfaceTo (dst);
     211    AssertComRCReturnRC(rc);
     212    metric.queryInterfaceTo(dst);
    213213    return rc;
    214214}
     
    217217PerformanceCollector::GetMetrics (ComSafeArrayIn (IN_BSTR, metricNames),
    218218                                  ComSafeArrayIn (IUnknown *, objects),
    219                                   ComSafeArrayOut (IPerformanceMetric *, outMetrics))
     219                                  ComSafeArrayOut(IPerformanceMetric *, outMetrics))
    220220{
    221221    LogFlowThisFuncEnter();
    222     //LogFlowThisFunc (("mState=%d, mType=%d\n", mState, mType));
     222    //LogFlowThisFunc(("mState=%d, mType=%d\n", mState, mType));
    223223
    224224    HRESULT rc = S_OK;
    225225
    226     AutoCaller autoCaller (this);
    227     CheckComRCReturnRC (autoCaller.rc());
     226    AutoCaller autoCaller(this);
     227    CheckComRCReturnRC(autoCaller.rc());
    228228
    229229    pm::Filter filter (ComSafeArrayInArg (metricNames),
    230230                       ComSafeArrayInArg (objects));
    231231
    232     AutoReadLock alock (this);
     232    AutoReadLock alock(this);
    233233
    234234    MetricList filteredMetrics;
     
    242242    for (it = filteredMetrics.begin(); it != filteredMetrics.end(); ++it)
    243243    {
    244         ComObjPtr <PerformanceMetric> metric;
     244        ComObjPtr<PerformanceMetric> metric;
    245245        rc = metric.createObject();
    246         if (SUCCEEDED (rc))
     246        if (SUCCEEDED(rc))
    247247            rc = metric->init (*it);
    248         AssertComRCReturnRC (rc);
     248        AssertComRCReturnRC(rc);
    249249        LogFlow (("PerformanceCollector::GetMetrics() store a metric at "
    250250                  "retMetrics[%d]...\n", i));
    251         metric.queryInterfaceTo (&retMetrics [i++]);
     251        metric.queryInterfaceTo(&retMetrics [i++]);
    252252    }
    253     retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     253    retMetrics.detachTo(ComSafeArrayOutArg(outMetrics));
    254254    LogFlowThisFuncLeave();
    255255    return rc;
     
    260260                                    ComSafeArrayIn (IUnknown *, objects),
    261261                                    ULONG aPeriod, ULONG aCount,
    262                                     ComSafeArrayOut (IPerformanceMetric *,
     262                                    ComSafeArrayOut(IPerformanceMetric *,
    263263                                                     outMetrics))
    264264{
    265     AutoCaller autoCaller (this);
    266     CheckComRCReturnRC (autoCaller.rc());
     265    AutoCaller autoCaller(this);
     266    CheckComRCReturnRC(autoCaller.rc());
    267267
    268268    pm::Filter filter (ComSafeArrayInArg (metricNames),
    269269                       ComSafeArrayInArg (objects));
    270270
    271     AutoWriteLock alock (this);
     271    AutoWriteLock alock(this);
    272272
    273273    HRESULT rc = S_OK;
     
    298298    int i = 0;
    299299    for (it = filteredMetrics.begin();
    300          it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     300         it != filteredMetrics.end() && SUCCEEDED(rc); ++it)
    301301        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    302     retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     302    retMetrics.detachTo(ComSafeArrayOutArg(outMetrics));
    303303
    304304    LogFlowThisFuncLeave();
     
    309309PerformanceCollector::EnableMetrics (ComSafeArrayIn (IN_BSTR, metricNames),
    310310                                     ComSafeArrayIn (IUnknown *, objects),
    311                                      ComSafeArrayOut (IPerformanceMetric *,
     311                                     ComSafeArrayOut(IPerformanceMetric *,
    312312                                                      outMetrics))
    313313{
    314     AutoCaller autoCaller (this);
    315     CheckComRCReturnRC (autoCaller.rc());
     314    AutoCaller autoCaller(this);
     315    CheckComRCReturnRC(autoCaller.rc());
    316316
    317317    pm::Filter filter (ComSafeArrayInArg (metricNames),
    318318                       ComSafeArrayInArg (objects));
    319319
    320     AutoWriteLock alock (this); /* Write lock is not needed atm since we are */
     320    AutoWriteLock alock(this); /* Write lock is not needed atm since we are */
    321321                                /* fiddling with enable bit only, but we */
    322322                                /* care for those who come next :-). */
     
    335335    int i = 0;
    336336    for (it = filteredMetrics.begin();
    337          it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     337         it != filteredMetrics.end() && SUCCEEDED(rc); ++it)
    338338        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    339     retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     339    retMetrics.detachTo(ComSafeArrayOutArg(outMetrics));
    340340
    341341    LogFlowThisFuncLeave();
     
    346346PerformanceCollector::DisableMetrics (ComSafeArrayIn (IN_BSTR, metricNames),
    347347                                      ComSafeArrayIn (IUnknown *, objects),
    348                                       ComSafeArrayOut (IPerformanceMetric *,
     348                                      ComSafeArrayOut(IPerformanceMetric *,
    349349                                                       outMetrics))
    350350{
    351     AutoCaller autoCaller (this);
    352     CheckComRCReturnRC (autoCaller.rc());
     351    AutoCaller autoCaller(this);
     352    CheckComRCReturnRC(autoCaller.rc());
    353353
    354354    pm::Filter filter (ComSafeArrayInArg (metricNames),
    355355                       ComSafeArrayInArg (objects));
    356356
    357     AutoWriteLock alock (this); /* Write lock is not needed atm since we are */
     357    AutoWriteLock alock(this); /* Write lock is not needed atm since we are */
    358358                                /* fiddling with enable bit only, but we */
    359359                                /* care for those who come next :-). */
     
    372372    int i = 0;
    373373    for (it = filteredMetrics.begin();
    374          it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     374         it != filteredMetrics.end() && SUCCEEDED(rc); ++it)
    375375        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    376     retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     376    retMetrics.detachTo(ComSafeArrayOutArg(outMetrics));
    377377
    378378    LogFlowThisFuncLeave();
     
    383383PerformanceCollector::QueryMetricsData (ComSafeArrayIn (IN_BSTR, metricNames),
    384384                                        ComSafeArrayIn (IUnknown *, objects),
    385                                         ComSafeArrayOut (BSTR, outMetricNames),
    386                                         ComSafeArrayOut (IUnknown *, outObjects),
    387                                         ComSafeArrayOut (BSTR, outUnits),
    388                                         ComSafeArrayOut (ULONG, outScales),
    389                                         ComSafeArrayOut (ULONG, outSequenceNumbers),
    390                                         ComSafeArrayOut (ULONG, outDataIndices),
    391                                         ComSafeArrayOut (ULONG, outDataLengths),
    392                                         ComSafeArrayOut (LONG, outData))
    393 {
    394     AutoCaller autoCaller (this);
    395     CheckComRCReturnRC (autoCaller.rc());
     385                                        ComSafeArrayOut(BSTR, outMetricNames),
     386                                        ComSafeArrayOut(IUnknown *, outObjects),
     387                                        ComSafeArrayOut(BSTR, outUnits),
     388                                        ComSafeArrayOut(ULONG, outScales),
     389                                        ComSafeArrayOut(ULONG, outSequenceNumbers),
     390                                        ComSafeArrayOut(ULONG, outDataIndices),
     391                                        ComSafeArrayOut(ULONG, outDataLengths),
     392                                        ComSafeArrayOut(LONG, outData))
     393{
     394    AutoCaller autoCaller(this);
     395    CheckComRCReturnRC(autoCaller.rc());
    396396
    397397    pm::Filter filter (ComSafeArrayInArg (metricNames),
    398398                       ComSafeArrayInArg (objects));
    399399
    400     AutoReadLock alock (this);
     400    AutoReadLock alock(this);
    401401
    402402    /* Let's compute the size of the resulting flat array */
     
    414414    size_t flatIndex = 0;
    415415    size_t numberOfMetrics = filteredMetrics.size();
    416     com::SafeArray <BSTR> retNames (numberOfMetrics);
    417     com::SafeIfaceArray <IUnknown> retObjects (numberOfMetrics);
    418     com::SafeArray <BSTR> retUnits (numberOfMetrics);
    419     com::SafeArray <ULONG> retScales (numberOfMetrics);
    420     com::SafeArray <ULONG> retSequenceNumbers (numberOfMetrics);
    421     com::SafeArray <ULONG> retIndices (numberOfMetrics);
    422     com::SafeArray <ULONG> retLengths (numberOfMetrics);
    423     com::SafeArray <LONG> retData (flatSize);
     416    com::SafeArray<BSTR> retNames (numberOfMetrics);
     417    com::SafeIfaceArray<IUnknown> retObjects (numberOfMetrics);
     418    com::SafeArray<BSTR> retUnits (numberOfMetrics);
     419    com::SafeArray<ULONG> retScales (numberOfMetrics);
     420    com::SafeArray<ULONG> retSequenceNumbers (numberOfMetrics);
     421    com::SafeArray<ULONG> retIndices (numberOfMetrics);
     422    com::SafeArray<ULONG> retLengths (numberOfMetrics);
     423    com::SafeArray<LONG> retData (flatSize);
    424424
    425425    for (it = filteredMetrics.begin(); it != filteredMetrics.end(); ++it, ++i)
     
    433433        Bstr tmp((*it)->getName());
    434434        tmp.detachTo(&retNames[i]);
    435         (*it)->getObject().queryInterfaceTo (&retObjects[i]);
     435        (*it)->getObject().queryInterfaceTo(&retObjects[i]);
    436436        tmp = (*it)->getUnit();
    437437        tmp.detachTo(&retUnits[i]);
     
    443443    }
    444444
    445     retNames.detachTo (ComSafeArrayOutArg (outMetricNames));
    446     retObjects.detachTo (ComSafeArrayOutArg (outObjects));
    447     retUnits.detachTo (ComSafeArrayOutArg (outUnits));
    448     retScales.detachTo (ComSafeArrayOutArg (outScales));
    449     retSequenceNumbers.detachTo (ComSafeArrayOutArg (outSequenceNumbers));
    450     retIndices.detachTo (ComSafeArrayOutArg (outDataIndices));
    451     retLengths.detachTo (ComSafeArrayOutArg (outDataLengths));
    452     retData.detachTo (ComSafeArrayOutArg (outData));
     445    retNames.detachTo(ComSafeArrayOutArg(outMetricNames));
     446    retObjects.detachTo(ComSafeArrayOutArg(outObjects));
     447    retUnits.detachTo(ComSafeArrayOutArg(outUnits));
     448    retScales.detachTo(ComSafeArrayOutArg(outScales));
     449    retSequenceNumbers.detachTo(ComSafeArrayOutArg(outSequenceNumbers));
     450    retIndices.detachTo(ComSafeArrayOutArg(outDataIndices));
     451    retLengths.detachTo(ComSafeArrayOutArg(outDataLengths));
     452    retData.detachTo(ComSafeArrayOutArg(outData));
    453453    return S_OK;
    454454}
     
    460460{
    461461    //LogFlowThisFuncEnter();
    462     AutoCaller autoCaller (this);
    463     if (!SUCCEEDED (autoCaller.rc())) return;
    464 
    465     AutoWriteLock alock (this);
     462    AutoCaller autoCaller(this);
     463    if (!SUCCEEDED(autoCaller.rc())) return;
     464
     465    AutoWriteLock alock(this);
    466466    LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, (void *)baseMetric->getObject(), baseMetric->getName()));
    467467    m.baseMetrics.push_back (baseMetric);
     
    472472{
    473473    //LogFlowThisFuncEnter();
    474     AutoCaller autoCaller (this);
    475     if (!SUCCEEDED (autoCaller.rc())) return;
    476 
    477     AutoWriteLock alock (this);
     474    AutoCaller autoCaller(this);
     475    if (!SUCCEEDED(autoCaller.rc())) return;
     476
     477    AutoWriteLock alock(this);
    478478    LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p name=%s\n", this, __PRETTY_FUNCTION__, (void *)metric->getObject(), metric->getName()));
    479479    m.metrics.push_back (metric);
     
    481481}
    482482
    483 void PerformanceCollector::unregisterBaseMetricsFor (const ComPtr <IUnknown> &aObject)
     483void PerformanceCollector::unregisterBaseMetricsFor (const ComPtr<IUnknown> &aObject)
    484484{
    485485    //LogFlowThisFuncEnter();
    486     AutoCaller autoCaller (this);
    487     if (!SUCCEEDED (autoCaller.rc())) return;
    488 
    489     AutoWriteLock alock (this);
     486    AutoCaller autoCaller(this);
     487    if (!SUCCEEDED(autoCaller.rc())) return;
     488
     489    AutoWriteLock alock(this);
    490490    LogAleksey(("{%p} " LOG_FN_FMT ": before remove_if: m.baseMetrics.size()=%d\n", this, __PRETTY_FUNCTION__, m.baseMetrics.size()));
    491491    BaseMetricList::iterator it;
     
    502502}
    503503
    504 void PerformanceCollector::unregisterMetricsFor (const ComPtr <IUnknown> &aObject)
     504void PerformanceCollector::unregisterMetricsFor (const ComPtr<IUnknown> &aObject)
    505505{
    506506    //LogFlowThisFuncEnter();
    507     AutoCaller autoCaller (this);
    508     if (!SUCCEEDED (autoCaller.rc())) return;
    509 
    510     AutoWriteLock alock (this);
     507    AutoCaller autoCaller(this);
     508    if (!SUCCEEDED(autoCaller.rc())) return;
     509
     510    AutoWriteLock alock(this);
    511511    LogAleksey(("{%p} " LOG_FN_FMT ": obj=%p\n", this, __PRETTY_FUNCTION__, (void *)aObject));
    512512    MetricList::iterator it;
     
    524524void PerformanceCollector::suspendSampling()
    525525{
    526     AutoCaller autoCaller (this);
    527     if (!SUCCEEDED (autoCaller.rc())) return;
     526    AutoCaller autoCaller(this);
     527    if (!SUCCEEDED(autoCaller.rc())) return;
    528528
    529529    int rc = RTTimerLRStop(m.sampler);
     
    533533void PerformanceCollector::resumeSampling()
    534534{
    535     AutoCaller autoCaller (this);
    536     if (!SUCCEEDED (autoCaller.rc())) return;
     535    AutoCaller autoCaller(this);
     536    if (!SUCCEEDED(autoCaller.rc())) return;
    537537
    538538    int rc = RTTimerLRStart(m.sampler, 0);
     
    561561{
    562562    Log4(("{%p} " LOG_FN_FMT ": ENTER\n", this, __PRETTY_FUNCTION__));
    563     AutoWriteLock alock (this);
     563    AutoWriteLock alock(this);
    564564
    565565    pm::CollectorHints hints;
     
    604604HRESULT PerformanceMetric::FinalConstruct()
    605605{
    606     LogFlowThisFunc (("\n"));
     606    LogFlowThisFunc(("\n"));
    607607
    608608    return S_OK;
     
    611611void PerformanceMetric::FinalRelease()
    612612{
    613     LogFlowThisFunc (("\n"));
     613    LogFlowThisFunc(("\n"));
    614614
    615615    uninit ();
     
    654654    /// AutoReadLock? Is the underlying metric a constant object?
    655655
    656     m.name.cloneTo (aMetricName);
     656    m.name.cloneTo(aMetricName);
    657657    return S_OK;
    658658}
     
    666666STDMETHODIMP PerformanceMetric::COMGETTER(Description) (BSTR *aDescription)
    667667{
    668     m.description.cloneTo (aDescription);
     668    m.description.cloneTo(aDescription);
    669669    return S_OK;
    670670}
  • trunk/src/VBox/Main/ProgressImpl.cpp

    r20220 r21878  
    103103
    104104    AutoCaller autoCaller(this);
    105     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     105    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    106106
    107107#if !defined (VBOX_COM_INPROC)
    108     AssertReturn (aParent, E_INVALIDARG);
     108    AssertReturn(aParent, E_INVALIDARG);
    109109#else
    110     AssertReturn (aInitiator, E_INVALIDARG);
     110    AssertReturn(aInitiator, E_INVALIDARG);
    111111#endif
    112112
    113     AssertReturn (aDescription, E_INVALIDARG);
     113    AssertReturn(aDescription, E_INVALIDARG);
    114114
    115115#if !defined (VBOX_COM_INPROC)
    116116    /* share parent weakly */
    117     unconst (mParent) = aParent;
     117    unconst(mParent) = aParent;
    118118
    119119    /* register with parent early, since uninit() will unconditionally
     
    127127     * that it is the same as the parent */
    128128    if (aInitiator && !mParent.equalsTo (aInitiator))
    129         unconst (mInitiator) = aInitiator;
     129        unconst(mInitiator) = aInitiator;
    130130#else
    131     unconst (mInitiator) = aInitiator;
     131    unconst(mInitiator) = aInitiator;
    132132#endif
    133133
    134     unconst (mId).create();
     134    unconst(mId).create();
    135135    if (aId)
    136         mId.cloneTo (aId);
     136        mId.cloneTo(aId);
    137137
    138138#if !defined (VBOX_COM_INPROC)
     
    142142#endif
    143143
    144     unconst (mDescription) = aDescription;
     144    unconst(mDescription) = aDescription;
    145145
    146146    return S_OK;
     
    181181    /* release initiator (effective only if mInitiator has been assigned in
    182182     * init()) */
    183     unconst (mInitiator).setNull();
     183    unconst(mInitiator).setNull();
    184184
    185185#if !defined (VBOX_COM_INPROC)
     
    192192        mParent->removeDependentChild (this);
    193193
    194         unconst (mParent).setNull();
     194        unconst(mParent).setNull();
    195195    }
    196196#endif
     
    208208
    209209    /* mId is constant during life time, no need to lock */
    210     mId.toUtf16().cloneTo (aId);
     210    mId.toUtf16().cloneTo(aId);
    211211
    212212    return S_OK;
     
    221221
    222222    /* mDescription is constant during life time, no need to lock */
    223     mDescription.cloneTo (aDescription);
     223    mDescription.cloneTo(aDescription);
    224224
    225225    return S_OK;
     
    237237#if !defined (VBOX_COM_INPROC)
    238238    if (mInitiator)
    239         mInitiator.queryInterfaceTo (aInitiator);
     239        mInitiator.queryInterfaceTo(aInitiator);
    240240    else
    241         mParent.queryInterfaceTo (aInitiator);
     241        mParent.queryInterfaceTo(aInitiator);
    242242#else
    243     mInitiator.queryInterfaceTo (aInitiator);
     243    mInitiator.queryInterfaceTo(aInitiator);
    244244#endif
    245245
     
    254254    CheckComRCReturnRC(autoCaller.rc());
    255255
    256     AutoReadLock alock (this);
     256    AutoReadLock alock(this);
    257257
    258258    *aCancelable = mCancelable;
     
    325325    AutoReadLock alock(this);
    326326
    327     if (mCompleted && SUCCEEDED (mResultCode))
     327    if (mCompleted && SUCCEEDED(mResultCode))
    328328        *aPercent = 100;
    329329    else
     
    351351    CheckComRCReturnRC(autoCaller.rc());
    352352
    353     AutoReadLock alock (this);
     353    AutoReadLock alock(this);
    354354
    355355    *aCompleted = mCompleted;
     
    365365    CheckComRCReturnRC(autoCaller.rc());
    366366
    367     AutoReadLock alock (this);
     367    AutoReadLock alock(this);
    368368
    369369    *aCanceled = mCanceled;
     
    379379    CheckComRCReturnRC(autoCaller.rc());
    380380
    381     AutoReadLock alock (this);
     381    AutoReadLock alock(this);
    382382
    383383    if (!mCompleted)
     
    397397    CheckComRCReturnRC(autoCaller.rc());
    398398
    399     AutoReadLock alock (this);
     399    AutoReadLock alock(this);
    400400
    401401    if (!mCompleted)
     
    403403            tr ("Error info is not available, operation is still in progress"));
    404404
    405     mErrorInfo.queryInterfaceTo (aErrorInfo);
     405    mErrorInfo.queryInterfaceTo(aErrorInfo);
    406406
    407407    return S_OK;
     
    415415    CheckComRCReturnRC(autoCaller.rc());
    416416
    417     AutoReadLock alock (this);
     417    AutoReadLock alock(this);
    418418
    419419    *aOperationCount = m_cOperations;
     
    429429    CheckComRCReturnRC(autoCaller.rc());
    430430
    431     AutoReadLock alock (this);
     431    AutoReadLock alock(this);
    432432
    433433    *aOperation = m_ulCurrentOperation;
     
    443443    CheckComRCReturnRC(autoCaller.rc());
    444444
    445     AutoReadLock alock (this);
     445    AutoReadLock alock(this);
    446446
    447447    m_bstrOperationDescription.cloneTo(aOperationDescription);
     
    457457    CheckComRCReturnRC(autoCaller.rc());
    458458
    459     AutoReadLock alock (this);
    460 
    461     if (mCompleted && SUCCEEDED (mResultCode))
     459    AutoReadLock alock(this);
     460
     461    if (mCompleted && SUCCEEDED(mResultCode))
    462462        *aOperationPercent = 100;
    463463    else
     
    490490HRESULT ProgressBase::setErrorInfoOnThread (IProgress *aProgress)
    491491{
    492     AssertReturn (aProgress != NULL, E_INVALIDARG);
     492    AssertReturn(aProgress != NULL, E_INVALIDARG);
    493493
    494494    LONG iRc;
    495495    HRESULT rc = aProgress->COMGETTER(ResultCode) (&iRc);
    496     AssertComRCReturnRC (rc);
     496    AssertComRCReturnRC(rc);
    497497    HRESULT resultCode = iRc;
    498498
     
    500500        return resultCode;
    501501
    502     ComPtr <IVirtualBoxErrorInfo> errorInfo;
     502    ComPtr<IVirtualBoxErrorInfo> errorInfo;
    503503    rc = aProgress->COMGETTER(ErrorInfo) (errorInfo.asOutParam());
    504     AssertComRCReturnRC (rc);
     504    AssertComRCReturnRC(rc);
    505505
    506506    if (!errorInfo.isNull())
     
    517517{
    518518    HRESULT rc = ProgressBase::FinalConstruct();
    519     CheckComRCReturnRC (rc);
     519    CheckComRCReturnRC(rc);
    520520
    521521    mCompletedSem = NIL_RTSEMEVENTMULTI;
     
    592592                        OUT_GUID aId /* = NULL */)
    593593{
    594     LogFlowThisFunc (("aDescription=\"%ls\"\n", aDescription));
     594    LogFlowThisFunc(("aDescription=\"%ls\"\n", aDescription));
    595595
    596596    AssertReturn(bstrFirstOperationDescription, E_INVALIDARG);
     
    598598
    599599    /* Enclose the state transition NotReady->InInit->Ready */
    600     AutoInitSpan autoInitSpan (this);
    601     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     600    AutoInitSpan autoInitSpan(this);
     601    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    602602
    603603    HRESULT rc = S_OK;
     
    608608#endif
    609609                                      aInitiator, aDescription, aId);
    610     CheckComRCReturnRC (rc);
     610    CheckComRCReturnRC(rc);
    611611
    612612    mCancelable = aCancelable;
     
    626626
    627627    /* Confirm a successful initialization when it's the case */
    628     if (SUCCEEDED (rc))
     628    if (SUCCEEDED(rc))
    629629        autoInitSpan.setSucceeded();
    630630
     
    651651                       CBSTR aOperationDescription)
    652652{
    653     LogFlowThisFunc (("aOperationDescription=\"%ls\"\n", aOperationDescription));
     653    LogFlowThisFunc(("aOperationDescription=\"%ls\"\n", aOperationDescription));
    654654
    655655    /* Enclose the state transition NotReady->InInit->Ready */
    656     AutoInitSpan autoInitSpan (this);
    657     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     656    AutoInitSpan autoInitSpan(this);
     657    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    658658
    659659    HRESULT rc = S_OK;
    660660
    661661    rc = ProgressBase::protectedInit (autoInitSpan);
    662     CheckComRCReturnRC (rc);
     662    CheckComRCReturnRC(rc);
    663663
    664664    mCancelable = aCancelable;
     
    680680
    681681    /* Confirm a successful initialization when it's the case */
    682     if (SUCCEEDED (rc))
     682    if (SUCCEEDED(rc))
    683683        autoInitSpan.setSucceeded();
    684684
     
    693693void Progress::uninit()
    694694{
    695     LogFlowThisFunc (("\n"));
     695    LogFlowThisFunc(("\n"));
    696696
    697697    /* Enclose the state transition Ready->InUninit->NotReady */
    698     AutoUninitSpan autoUninitSpan (this);
     698    AutoUninitSpan autoUninitSpan(this);
    699699    if (autoUninitSpan.uninitDone())
    700700        return;
     
    728728{
    729729    LogFlowThisFuncEnter();
    730     LogFlowThisFunc (("aTimeout=%d\n", aTimeout));
     730    LogFlowThisFunc(("aTimeout=%d\n", aTimeout));
    731731
    732732    AutoCaller autoCaller(this);
     
    759759                RTSemEventMultiReset (mCompletedSem);
    760760
    761             if (RT_FAILURE (vrc) && vrc != VERR_TIMEOUT)
     761            if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
    762762                break;
    763763
     
    770770        }
    771771
    772         if (RT_FAILURE (vrc) && vrc != VERR_TIMEOUT)
     772        if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
    773773            return setError (VBOX_E_IPRT_ERROR,
    774774                tr ("Failed to wait for the task completion (%Rrc)"), vrc);
     
    789789{
    790790    LogFlowThisFuncEnter();
    791     LogFlowThisFunc (("aOperation=%d, aTimeout=%d\n", aOperation, aTimeout));
     791    LogFlowThisFunc(("aOperation=%d, aTimeout=%d\n", aOperation, aTimeout));
    792792
    793793    AutoCaller autoCaller(this);
     
    826826                RTSemEventMultiReset (mCompletedSem);
    827827
    828             if (RT_FAILURE (vrc) && vrc != VERR_TIMEOUT)
     828            if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
    829829                break;
    830830
     
    837837        }
    838838
    839         if (RT_FAILURE (vrc) && vrc != VERR_TIMEOUT)
     839        if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
    840840            return setError (E_FAIL,
    841841                tr ("Failed to wait for the operation completion (%Rrc)"), vrc);
     
    874874{
    875875    AutoCaller autoCaller(this);
    876     AssertComRCReturnRC (autoCaller.rc());
     876    AssertComRCReturnRC(autoCaller.rc());
    877877
    878878    AutoWriteLock alock(this);
     
    886886    }
    887887    else
    888         AssertReturn (!mCompleted && !mCanceled, E_FAIL);
     888        AssertReturn(!mCompleted && !mCanceled, E_FAIL);
    889889
    890890    m_ulOperationPercent = aPercent;
     
    906906
    907907    AutoCaller autoCaller(this);
    908     AssertComRCReturnRC (autoCaller.rc());
    909 
    910     AutoWriteLock alock(this);
    911 
    912     AssertReturn (!mCompleted && !mCanceled, E_FAIL);
    913     AssertReturn (m_ulCurrentOperation + 1 < m_cOperations, E_FAIL);
     908    AssertComRCReturnRC(autoCaller.rc());
     909
     910    AutoWriteLock alock(this);
     911
     912    AssertReturn(!mCompleted && !mCanceled, E_FAIL);
     913    AssertReturn(m_ulCurrentOperation + 1 < m_cOperations, E_FAIL);
    914914
    915915    ++m_ulCurrentOperation;
     
    938938 * such case).
    939939 *
    940  * If the result code indicates a success (|SUCCEEDED (@a aResultCode)|) then
     940 * If the result code indicates a success (|SUCCEEDED(@a aResultCode)|) then
    941941 * the current operation is set to the last.
    942942 *
     
    949949{
    950950    AutoCaller autoCaller(this);
    951     AssertComRCReturnRC (autoCaller.rc());
    952 
    953     AutoWriteLock alock(this);
    954 
    955     AssertReturn (mCompleted == FALSE, E_FAIL);
     951    AssertComRCReturnRC(autoCaller.rc());
     952
     953    AutoWriteLock alock(this);
     954
     955    AssertReturn(mCompleted == FALSE, E_FAIL);
    956956
    957957    if (mCanceled && SUCCEEDED(aResultCode))
     
    969969#if !defined (VBOX_WITH_XPCOM)
    970970
    971         ComPtr <IErrorInfo> err;
     971        ComPtr<IErrorInfo> err;
    972972        rc = ::GetErrorInfo (0, err.asOutParam());
    973973        if (rc == S_OK && err)
    974974        {
    975             rc = err.queryInterfaceTo (mErrorInfo.asOutParam());
    976             if (SUCCEEDED (rc) && !mErrorInfo)
     975            rc = err.queryInterfaceTo(mErrorInfo.asOutParam());
     976            if (SUCCEEDED(rc) && !mErrorInfo)
    977977                rc = E_FAIL;
    978978        }
     
    982982        nsCOMPtr <nsIExceptionService> es;
    983983        es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    984         if (NS_SUCCEEDED (rc))
     984        if (NS_SUCCEEDED(rc))
    985985        {
    986986            nsCOMPtr <nsIExceptionManager> em;
    987987            rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
    988             if (NS_SUCCEEDED (rc))
     988            if (NS_SUCCEEDED(rc))
    989989            {
    990                 ComPtr <nsIException> ex;
     990                ComPtr<nsIException> ex;
    991991                rc = em->GetCurrentException (ex.asOutParam());
    992                 if (NS_SUCCEEDED (rc) && ex)
     992                if (NS_SUCCEEDED(rc) && ex)
    993993                {
    994                     rc = ex.queryInterfaceTo (mErrorInfo.asOutParam());
    995                     if (NS_SUCCEEDED (rc) && !mErrorInfo)
     994                    rc = ex.queryInterfaceTo(mErrorInfo.asOutParam());
     995                    if (NS_SUCCEEDED(rc) && !mErrorInfo)
    996996                        rc = E_FAIL;
    997997                }
     
    10651065{
    10661066    AutoCaller autoCaller(this);
    1067     AssertComRCReturnRC (autoCaller.rc());
    1068 
    1069     AutoWriteLock alock(this);
    1070 
    1071     AssertReturn (mCompleted == FALSE, E_FAIL);
     1067    AssertComRCReturnRC(autoCaller.rc());
     1068
     1069    AutoWriteLock alock(this);
     1070
     1071    AssertReturn(mCompleted == FALSE, E_FAIL);
    10721072
    10731073    if (mCanceled && SUCCEEDED(aResultCode))
     
    10771077    mResultCode = aResultCode;
    10781078
    1079     AssertReturn (FAILED (aResultCode), E_FAIL);
    1080 
    1081     ComObjPtr <VirtualBoxErrorInfo> errorInfo;
     1079    AssertReturn(FAILED (aResultCode), E_FAIL);
     1080
     1081    ComObjPtr<VirtualBoxErrorInfo> errorInfo;
    10821082    HRESULT rc = errorInfo.createObject();
    10831083    AssertComRC (rc);
    1084     if (SUCCEEDED (rc))
     1084    if (SUCCEEDED(rc))
    10851085    {
    10861086        errorInfo->init (aResultCode, aIID, aComponent, aText);
    1087         errorInfo.queryInterfaceTo (mErrorInfo.asOutParam());
     1087        errorInfo.queryInterfaceTo(mErrorInfo.asOutParam());
    10881088    }
    10891089
     
    11081108{
    11091109    HRESULT rc = ProgressBase::FinalConstruct();
    1110     CheckComRCReturnRC (rc);
     1110    CheckComRCReturnRC(rc);
    11111111
    11121112    mProgress = 0;
     
    11411141                                         CBSTR aDescription, OUT_GUID aId)
    11421142{
    1143     LogFlowThisFunc (("aDescription={%ls} mProgresses.size()=%d\n",
     1143    LogFlowThisFunc(("aDescription={%ls} mProgresses.size()=%d\n",
    11441144                      aDescription, mProgresses.size()));
    11451145
     
    11511151#endif
    11521152                                      aInitiator, aDescription, aId);
    1153     CheckComRCReturnRC (rc);
     1153    CheckComRCReturnRC(rc);
    11541154
    11551155    mProgress = 0; /* the first object */
     
    11651165    rc = mProgresses [0]->COMGETTER(OperationDescription) (
    11661166        m_bstrOperationDescription.asOutParam());
    1167     CheckComRCReturnRC (rc);
     1167    CheckComRCReturnRC(rc);
    11681168
    11691169    for (size_t i = 0; i < mProgresses.size(); i ++)
     
    11731173            BOOL cancelable = FALSE;
    11741174            rc = mProgresses [i]->COMGETTER(Cancelable) (&cancelable);
    1175             CheckComRCReturnRC (rc);
     1175            CheckComRCReturnRC(rc);
    11761176
    11771177            if (!cancelable)
     
    11821182            ULONG opCount = 0;
    11831183            rc = mProgresses [i]->COMGETTER(OperationCount) (&opCount);
    1184             CheckComRCReturnRC (rc);
     1184            CheckComRCReturnRC(rc);
    11851185
    11861186            m_cOperations += opCount;
     
    11891189
    11901190    rc =  checkProgress();
    1191     CheckComRCReturnRC (rc);
     1191    CheckComRCReturnRC(rc);
    11921192
    11931193    return rc;
     
    12151215{
    12161216    /* Enclose the state transition NotReady->InInit->Ready */
    1217     AutoInitSpan autoInitSpan (this);
    1218     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     1217    AutoInitSpan autoInitSpan(this);
     1218    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    12191219
    12201220    mProgresses.resize (2);
     
    12291229
    12301230    /* Confirm a successful initialization when it's the case */
    1231     if (SUCCEEDED (rc))
     1231    if (SUCCEEDED(rc))
    12321232        autoInitSpan.setSucceeded();
    12331233
     
    12421242void CombinedProgress::uninit()
    12431243{
    1244     LogFlowThisFunc (("\n"));
     1244    LogFlowThisFunc(("\n"));
    12451245
    12461246    /* Enclose the state transition Ready->InUninit->NotReady */
    1247     AutoUninitSpan autoUninitSpan (this);
     1247    AutoUninitSpan autoUninitSpan(this);
    12481248    if (autoUninitSpan.uninitDone())
    12491249        return;
     
    12681268    AutoWriteLock alock(this);
    12691269
    1270     if (mCompleted && SUCCEEDED (mResultCode))
     1270    if (mCompleted && SUCCEEDED(mResultCode))
    12711271        *aPercent = 100;
    12721272    else
    12731273    {
    12741274        HRESULT rc = checkProgress();
    1275         CheckComRCReturnRC (rc);
     1275        CheckComRCReturnRC(rc);
    12761276
    12771277        /* global percent =
     
    12951295
    12961296    HRESULT rc = checkProgress();
    1297     CheckComRCReturnRC (rc);
     1297    CheckComRCReturnRC(rc);
    12981298
    12991299    return ProgressBase::COMGETTER(Completed) (aCompleted);
     
    13111311
    13121312    HRESULT rc = checkProgress();
    1313     CheckComRCReturnRC (rc);
     1313    CheckComRCReturnRC(rc);
    13141314
    13151315    return ProgressBase::COMGETTER(Canceled) (aCanceled);
     
    13271327
    13281328    HRESULT rc = checkProgress();
    1329     CheckComRCReturnRC (rc);
     1329    CheckComRCReturnRC(rc);
    13301330
    13311331    return ProgressBase::COMGETTER(ResultCode) (aResultCode);
     
    13431343
    13441344    HRESULT rc = checkProgress();
    1345     CheckComRCReturnRC (rc);
     1345    CheckComRCReturnRC(rc);
    13461346
    13471347    return ProgressBase::COMGETTER(ErrorInfo) (aErrorInfo);
     
    13591359
    13601360    HRESULT rc = checkProgress();
    1361     CheckComRCReturnRC (rc);
     1361    CheckComRCReturnRC(rc);
    13621362
    13631363    return ProgressBase::COMGETTER(Operation) (aOperation);
     
    13751375
    13761376    HRESULT rc = checkProgress();
    1377     CheckComRCReturnRC (rc);
     1377    CheckComRCReturnRC(rc);
    13781378
    13791379    return ProgressBase::COMGETTER(OperationDescription) (aOperationDescription);
     
    13911391
    13921392    HRESULT rc = checkProgress();
    1393     CheckComRCReturnRC (rc);
     1393    CheckComRCReturnRC(rc);
    13941394
    13951395    return ProgressBase::COMGETTER(OperationPercent) (aOperationPercent);
     
    14081408{
    14091409    LogFlowThisFuncEnter();
    1410     LogFlowThisFunc (("aTtimeout=%d\n", aTimeout));
     1410    LogFlowThisFunc(("aTtimeout=%d\n", aTimeout));
    14111411
    14121412    AutoCaller autoCaller(this);
     
    14331433            alock.enter();
    14341434
    1435             if (SUCCEEDED (rc))
     1435            if (SUCCEEDED(rc))
    14361436                rc = checkProgress();
    14371437
     
    14461446        }
    14471447
    1448         CheckComRCReturnRC (rc);
     1448        CheckComRCReturnRC(rc);
    14491449    }
    14501450
     
    14631463{
    14641464    LogFlowThisFuncEnter();
    1465     LogFlowThisFunc (("aOperation=%d, aTimeout=%d\n", aOperation, aTimeout));
     1465    LogFlowThisFunc(("aOperation=%d, aTimeout=%d\n", aOperation, aTimeout));
    14661466
    14671467    AutoCaller autoCaller(this);
     
    15031503        while (1);
    15041504
    1505         LogFlowThisFunc (("will wait for mProgresses [%d] (%d)\n",
     1505        LogFlowThisFunc(("will wait for mProgresses [%d] (%d)\n",
    15061506                          progress, operation));
    15071507
     
    15221522            alock.enter();
    15231523
    1524             if (SUCCEEDED (rc))
     1524            if (SUCCEEDED(rc))
    15251525                rc = checkProgress();
    15261526
     
    15351535        }
    15361536
    1537         CheckComRCReturnRC (rc);
     1537        CheckComRCReturnRC(rc);
    15381538    }
    15391539
     
    15731573        return S_OK;
    15741574
    1575     AssertReturn (mProgress < mProgresses.size(), E_FAIL);
    1576 
    1577     ComPtr <IProgress> progress = mProgresses [mProgress];
     1575    AssertReturn(mProgress < mProgresses.size(), E_FAIL);
     1576
     1577    ComPtr<IProgress> progress = mProgresses [mProgress];
    15781578    ComAssertRet (!progress.isNull(), E_FAIL);
    15791579
     
    16301630
    16311631    rc = progress->COMGETTER(OperationPercent) (&m_ulOperationPercent);
    1632     if (SUCCEEDED (rc))
     1632    if (SUCCEEDED(rc))
    16331633    {
    16341634        ULONG operation = 0;
    16351635        rc = progress->COMGETTER(Operation) (&operation);
    1636         if (SUCCEEDED (rc) && mCompletedOperations + operation > m_ulCurrentOperation)
     1636        if (SUCCEEDED(rc) && mCompletedOperations + operation > m_ulCurrentOperation)
    16371637        {
    16381638            m_ulCurrentOperation = mCompletedOperations + operation;
  • trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp

    r19239 r21878  
    5656HRESULT RemoteUSBDevice::init (uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevDesc)
    5757{
    58     LogFlowThisFunc (("u32ClientId=%d,pDevDesc=%p\n", u32ClientId, pDevDesc));
     58    LogFlowThisFunc(("u32ClientId=%d,pDevDesc=%p\n", u32ClientId, pDevDesc));
    5959
    6060    /* Enclose the state transition NotReady->InInit->Ready */
    61     AutoInitSpan autoInitSpan (this);
    62     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    63 
    64     unconst (mData.id).create();
    65 
    66     unconst (mData.vendorId)     = pDevDesc->idVendor;
    67     unconst (mData.productId)    = pDevDesc->idProduct;
    68     unconst (mData.revision)     = pDevDesc->bcdRev;
    69 
    70     unconst (mData.manufacturer) = pDevDesc->oManufacturer? (char *)pDevDesc + pDevDesc->oManufacturer: "";
    71     unconst (mData.product)      = pDevDesc->oProduct? (char *)pDevDesc + pDevDesc->oProduct: "";
    72     unconst (mData.serialNumber) = pDevDesc->oSerialNumber? (char *)pDevDesc + pDevDesc->oSerialNumber: "";
     61    AutoInitSpan autoInitSpan(this);
     62    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     63
     64    unconst(mData.id).create();
     65
     66    unconst(mData.vendorId)     = pDevDesc->idVendor;
     67    unconst(mData.productId)    = pDevDesc->idProduct;
     68    unconst(mData.revision)     = pDevDesc->bcdRev;
     69
     70    unconst(mData.manufacturer) = pDevDesc->oManufacturer? (char *)pDevDesc + pDevDesc->oManufacturer: "";
     71    unconst(mData.product)      = pDevDesc->oProduct? (char *)pDevDesc + pDevDesc->oProduct: "";
     72    unconst(mData.serialNumber) = pDevDesc->oSerialNumber? (char *)pDevDesc + pDevDesc->oSerialNumber: "";
    7373
    7474    char id[64];
    7575    RTStrPrintf(id, sizeof (id), REMOTE_USB_BACKEND_PREFIX_S "0x%08X&0x%08X", pDevDesc->id, u32ClientId);
    76     unconst (mData.address)      = id;
    77 
    78     unconst (mData.port)         = pDevDesc->idPort;
    79     unconst (mData.version)      = pDevDesc->bcdUSB >> 8;
    80     unconst (mData.portVersion)  = mData.version; /** @todo fix this */
     76    unconst(mData.address)      = id;
     77
     78    unconst(mData.port)         = pDevDesc->idPort;
     79    unconst(mData.version)      = pDevDesc->bcdUSB >> 8;
     80    unconst(mData.portVersion)  = mData.version; /** @todo fix this */
    8181
    8282    mData.state                  = USBDeviceState_Available;
    8383
    8484    mData.dirty                  = false;
    85     unconst (mData.devId)        = pDevDesc->id;
    86 
    87     unconst (mData.clientId)     = u32ClientId;
     85    unconst(mData.devId)        = pDevDesc->id;
     86
     87    unconst(mData.clientId)     = u32ClientId;
    8888
    8989    /* Confirm a successful initialization */
     
    100100void RemoteUSBDevice::uninit()
    101101{
    102     LogFlowThisFunc (("\n"));
     102    LogFlowThisFunc(("\n"));
    103103
    104104    /* Enclose the state transition Ready->InUninit->NotReady */
    105     AutoUninitSpan autoUninitSpan (this);
     105    AutoUninitSpan autoUninitSpan(this);
    106106    if (autoUninitSpan.uninitDone())
    107107        return;
    108108
    109     unconst (mData.id).clear();
    110 
    111     unconst (mData.vendorId) = 0;
    112     unconst (mData.productId) = 0;
    113     unconst (mData.revision) = 0;
    114 
    115     unconst (mData.manufacturer).setNull();
    116     unconst (mData.product).setNull();
    117     unconst (mData.serialNumber).setNull();
    118 
    119     unconst (mData.address).setNull();
    120 
    121     unconst (mData.port) = 0;
    122     unconst (mData.version) = 1;
    123     unconst (mData.portVersion) = 1;
    124 
    125     unconst (mData.dirty) = FALSE;
    126 
    127     unconst (mData.devId) = 0;
    128     unconst (mData.clientId) = 0;
     109    unconst(mData.id).clear();
     110
     111    unconst(mData.vendorId) = 0;
     112    unconst(mData.productId) = 0;
     113    unconst(mData.revision) = 0;
     114
     115    unconst(mData.manufacturer).setNull();
     116    unconst(mData.product).setNull();
     117    unconst(mData.serialNumber).setNull();
     118
     119    unconst(mData.address).setNull();
     120
     121    unconst(mData.port) = 0;
     122    unconst(mData.version) = 1;
     123    unconst(mData.portVersion) = 1;
     124
     125    unconst(mData.dirty) = FALSE;
     126
     127    unconst(mData.devId) = 0;
     128    unconst(mData.clientId) = 0;
    129129}
    130130
     
    136136    CheckComArgOutPointerValid(aId);
    137137
    138     AutoCaller autoCaller (this);
    139     CheckComRCReturnRC (autoCaller.rc());
    140 
    141     /* this is const, no need to lock */
    142     Bstr(mData.id).cloneTo (aId);
     138    AutoCaller autoCaller(this);
     139    CheckComRCReturnRC(autoCaller.rc());
     140
     141    /* this is const, no need to lock */
     142    Bstr(mData.id).cloneTo(aId);
    143143
    144144    return S_OK;
     
    149149    CheckComArgOutPointerValid(aVendorId);
    150150
    151     AutoCaller autoCaller (this);
    152     CheckComRCReturnRC (autoCaller.rc());
     151    AutoCaller autoCaller(this);
     152    CheckComRCReturnRC(autoCaller.rc());
    153153
    154154    /* this is const, no need to lock */
     
    162162    CheckComArgOutPointerValid(aProductId);
    163163
    164     AutoCaller autoCaller (this);
    165     CheckComRCReturnRC (autoCaller.rc());
     164    AutoCaller autoCaller(this);
     165    CheckComRCReturnRC(autoCaller.rc());
    166166
    167167    /* this is const, no need to lock */
     
    175175    CheckComArgOutPointerValid(aRevision);
    176176
    177     AutoCaller autoCaller (this);
    178     CheckComRCReturnRC (autoCaller.rc());
     177    AutoCaller autoCaller(this);
     178    CheckComRCReturnRC(autoCaller.rc());
    179179
    180180    /* this is const, no need to lock */
     
    188188    CheckComArgOutPointerValid(aManufacturer);
    189189
    190     AutoCaller autoCaller (this);
    191     CheckComRCReturnRC (autoCaller.rc());
    192 
    193     /* this is const, no need to lock */
    194     mData.manufacturer.cloneTo (aManufacturer);
     190    AutoCaller autoCaller(this);
     191    CheckComRCReturnRC(autoCaller.rc());
     192
     193    /* this is const, no need to lock */
     194    mData.manufacturer.cloneTo(aManufacturer);
    195195
    196196    return S_OK;
     
    201201    CheckComArgOutPointerValid(aProduct);
    202202
    203     AutoCaller autoCaller (this);
    204     CheckComRCReturnRC (autoCaller.rc());
    205 
    206     /* this is const, no need to lock */
    207     mData.product.cloneTo (aProduct);
     203    AutoCaller autoCaller(this);
     204    CheckComRCReturnRC(autoCaller.rc());
     205
     206    /* this is const, no need to lock */
     207    mData.product.cloneTo(aProduct);
    208208
    209209    return S_OK;
     
    214214    CheckComArgOutPointerValid(aSerialNumber);
    215215
    216     AutoCaller autoCaller (this);
    217     CheckComRCReturnRC (autoCaller.rc());
    218 
    219     /* this is const, no need to lock */
    220     mData.serialNumber.cloneTo (aSerialNumber);
     216    AutoCaller autoCaller(this);
     217    CheckComRCReturnRC(autoCaller.rc());
     218
     219    /* this is const, no need to lock */
     220    mData.serialNumber.cloneTo(aSerialNumber);
    221221
    222222    return S_OK;
     
    227227    CheckComArgOutPointerValid(aAddress);
    228228
    229     AutoCaller autoCaller (this);
    230     CheckComRCReturnRC (autoCaller.rc());
    231 
    232     /* this is const, no need to lock */
    233     mData.address.cloneTo (aAddress);
     229    AutoCaller autoCaller(this);
     230    CheckComRCReturnRC(autoCaller.rc());
     231
     232    /* this is const, no need to lock */
     233    mData.address.cloneTo(aAddress);
    234234
    235235    return S_OK;
     
    240240    CheckComArgOutPointerValid(aPort);
    241241
    242     AutoCaller autoCaller (this);
    243     CheckComRCReturnRC (autoCaller.rc());
     242    AutoCaller autoCaller(this);
     243    CheckComRCReturnRC(autoCaller.rc());
    244244
    245245    /* this is const, no need to lock */
     
    253253    CheckComArgOutPointerValid(aVersion);
    254254
    255     AutoCaller autoCaller (this);
    256     CheckComRCReturnRC (autoCaller.rc());
     255    AutoCaller autoCaller(this);
     256    CheckComRCReturnRC(autoCaller.rc());
    257257
    258258    /* this is const, no need to lock */
     
    266266    CheckComArgOutPointerValid(aPortVersion);
    267267
    268     AutoCaller autoCaller (this);
    269     CheckComRCReturnRC (autoCaller.rc());
     268    AutoCaller autoCaller(this);
     269    CheckComRCReturnRC(autoCaller.rc());
    270270
    271271    /* this is const, no need to lock */
     
    279279    CheckComArgOutPointerValid(aRemote);
    280280
    281     AutoCaller autoCaller (this);
    282     CheckComRCReturnRC (autoCaller.rc());
     281    AutoCaller autoCaller(this);
     282    CheckComRCReturnRC(autoCaller.rc());
    283283
    284284    /* RemoteUSBDevice is always remote. */
     
    296296    CheckComArgOutPointerValid(aState);
    297297
    298     AutoCaller autoCaller (this);
    299     CheckComRCReturnRC (autoCaller.rc());
    300 
    301     AutoReadLock alock (this);
     298    AutoCaller autoCaller(this);
     299    CheckComRCReturnRC(autoCaller.rc());
     300
     301    AutoReadLock alock(this);
    302302
    303303    *aState = mData.state;
  • trunk/src/VBox/Main/SerialPortImpl.cpp

    r21607 r21878  
    5656HRESULT SerialPort::init (Machine *aParent, ULONG aSlot)
    5757{
    58     LogFlowThisFunc (("aParent=%p, aSlot=%d\n", aParent, aSlot));
     58    LogFlowThisFunc(("aParent=%p, aSlot=%d\n", aParent, aSlot));
    5959
    6060    ComAssertRet (aParent, E_INVALIDARG);
    6161
    6262    /* Enclose the state transition NotReady->InInit->Ready */
    63     AutoInitSpan autoInitSpan (this);
    64     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    65 
    66     unconst (mParent) = aParent;
     63    AutoInitSpan autoInitSpan(this);
     64    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     65
     66    unconst(mParent) = aParent;
    6767    /* mPeer is left null */
    6868
     
    9090HRESULT SerialPort::init (Machine *aParent, SerialPort *aThat)
    9191{
    92     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     92    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    9393
    9494    ComAssertRet (aParent && aThat, E_INVALIDARG);
    9595
    9696    /* Enclose the state transition NotReady->InInit->Ready */
    97     AutoInitSpan autoInitSpan (this);
    98     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    99 
    100     unconst (mParent) = aParent;
    101     unconst (mPeer) = aThat;
     97    AutoInitSpan autoInitSpan(this);
     98    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     99
     100    unconst(mParent) = aParent;
     101    unconst(mPeer) = aThat;
    102102
    103103    AutoCaller thatCaller (aThat);
    104     AssertComRCReturnRC (thatCaller.rc());
     104    AssertComRCReturnRC(thatCaller.rc());
    105105
    106106    AutoReadLock thatLock (aThat);
     
    122122HRESULT SerialPort::initCopy (Machine *aParent, SerialPort *aThat)
    123123{
    124     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     124    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    125125
    126126    ComAssertRet (aParent && aThat, E_INVALIDARG);
    127127
    128128    /* Enclose the state transition NotReady->InInit->Ready */
    129     AutoInitSpan autoInitSpan (this);
    130     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    131 
    132     unconst (mParent) = aParent;
     129    AutoInitSpan autoInitSpan(this);
     130    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     131
     132    unconst(mParent) = aParent;
    133133    /* mPeer is left null */
    134134
    135135    AutoCaller thatCaller (aThat);
    136     AssertComRCReturnRC (thatCaller.rc());
     136    AssertComRCReturnRC(thatCaller.rc());
    137137
    138138    AutoReadLock thatLock (aThat);
     
    151151void SerialPort::uninit()
    152152{
    153     LogFlowThisFunc (("\n"));
     153    LogFlowThisFunc(("\n"));
    154154
    155155    /* Enclose the state transition Ready->InUninit->NotReady */
    156     AutoUninitSpan autoUninitSpan (this);
     156    AutoUninitSpan autoUninitSpan(this);
    157157    if (autoUninitSpan.uninitDone())
    158158        return;
     
    160160    mData.free();
    161161
    162     unconst (mPeer).setNull();
    163     unconst (mParent).setNull();
     162    unconst(mPeer).setNull();
     163    unconst(mParent).setNull();
    164164}
    165165
     
    179179    using namespace settings;
    180180
    181     AssertReturn (!aPortNode.isNull(), E_FAIL);
    182 
    183     AutoCaller autoCaller (this);
    184     AssertComRCReturnRC (autoCaller.rc());
    185 
    186     AutoWriteLock alock (this);
     181    AssertReturn(!aPortNode.isNull(), E_FAIL);
     182
     183    AutoCaller autoCaller(this);
     184    AssertComRCReturnRC(autoCaller.rc());
     185
     186    AutoWriteLock alock(this);
    187187
    188188    /* Note: we assume that the default values for attributes of optional
     
    219219    Bstr path = aPortNode.stringValue ("path");
    220220    HRESULT rc = checkSetPath (path);
    221     CheckComRCReturnRC (rc);
     221    CheckComRCReturnRC(rc);
    222222    mData->mPath = path;
    223223
     
    241241    using namespace settings;
    242242
    243     AssertReturn (!aPortNode.isNull(), E_FAIL);
    244 
    245     AutoCaller autoCaller (this);
    246     AssertComRCReturnRC (autoCaller.rc());
    247 
    248     AutoReadLock alock (this);
     243    AssertReturn(!aPortNode.isNull(), E_FAIL);
     244
     245    AutoCaller autoCaller(this);
     246    AssertComRCReturnRC(autoCaller.rc());
     247
     248    AutoReadLock alock(this);
    249249
    250250    aPortNode.setValue <bool> ("enabled", !!mData->mEnabled);
     
    291291{
    292292    /* sanity */
    293     AutoCaller autoCaller (this);
     293    AutoCaller autoCaller(this);
    294294    AssertComRCReturn (autoCaller.rc(), false);
    295295
    296     AutoWriteLock alock (this);
     296    AutoWriteLock alock(this);
    297297
    298298    bool changed = false;
     
    316316{
    317317    /* sanity */
    318     AutoCaller autoCaller (this);
     318    AutoCaller autoCaller(this);
    319319    AssertComRCReturnVoid (autoCaller.rc());
    320320
     
    347347
    348348    /* sanity */
    349     AutoCaller autoCaller (this);
     349    AutoCaller autoCaller(this);
    350350    AssertComRCReturnVoid (autoCaller.rc());
    351351
     
    367367
    368368    /* sanity */
    369     AutoCaller autoCaller (this);
     369    AutoCaller autoCaller(this);
    370370    AssertComRCReturnVoid (autoCaller.rc());
    371371
    372     AutoWriteLock alock (this);
     372    AutoWriteLock alock(this);
    373373
    374374    uint32_t numSerialEnabled = aOsType->numSerialEnabled();
     
    388388    CheckComArgOutPointerValid(aEnabled);
    389389
    390     AutoCaller autoCaller (this);
    391     CheckComRCReturnRC (autoCaller.rc());
    392 
    393     AutoReadLock alock (this);
     390    AutoCaller autoCaller(this);
     391    CheckComRCReturnRC(autoCaller.rc());
     392
     393    AutoReadLock alock(this);
    394394
    395395    *aEnabled = mData->mEnabled;
     
    400400STDMETHODIMP SerialPort::COMSETTER(Enabled) (BOOL aEnabled)
    401401{
    402     LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
    403 
    404     AutoCaller autoCaller (this);
    405     CheckComRCReturnRC (autoCaller.rc());
     402    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     403
     404    AutoCaller autoCaller(this);
     405    CheckComRCReturnRC(autoCaller.rc());
    406406
    407407    /* the machine needs to be mutable */
    408408    Machine::AutoMutableStateDependency adep (mParent);
    409     CheckComRCReturnRC (adep.rc());
    410 
    411     AutoWriteLock alock (this);
     409    CheckComRCReturnRC(adep.rc());
     410
     411    AutoWriteLock alock(this);
    412412
    413413    if (mData->mEnabled != aEnabled)
     
    429429    CheckComArgOutPointerValid(aHostMode);
    430430
    431     AutoCaller autoCaller (this);
    432     CheckComRCReturnRC (autoCaller.rc());
    433 
    434     AutoReadLock alock (this);
     431    AutoCaller autoCaller(this);
     432    CheckComRCReturnRC(autoCaller.rc());
     433
     434    AutoReadLock alock(this);
    435435
    436436    *aHostMode = mData->mHostMode;
     
    441441STDMETHODIMP SerialPort::COMSETTER(HostMode) (PortMode_T aHostMode)
    442442{
    443     AutoCaller autoCaller (this);
    444     CheckComRCReturnRC (autoCaller.rc());
     443    AutoCaller autoCaller(this);
     444    CheckComRCReturnRC(autoCaller.rc());
    445445
    446446    /* the machine needs to be mutable */
    447447    Machine::AutoMutableStateDependency adep (mParent);
    448     CheckComRCReturnRC (adep.rc());
    449 
    450     AutoWriteLock alock (this);
     448    CheckComRCReturnRC(adep.rc());
     449
     450    AutoWriteLock alock(this);
    451451
    452452    HRESULT rc = S_OK;
     
    503503    CheckComArgOutPointerValid(aSlot);
    504504
    505     AutoCaller autoCaller (this);
    506     CheckComRCReturnRC (autoCaller.rc());
    507 
    508     AutoReadLock alock (this);
     505    AutoCaller autoCaller(this);
     506    CheckComRCReturnRC(autoCaller.rc());
     507
     508    AutoReadLock alock(this);
    509509
    510510    *aSlot = mData->mSlot;
     
    517517    CheckComArgOutPointerValid(aIRQ);
    518518
    519     AutoCaller autoCaller (this);
    520     CheckComRCReturnRC (autoCaller.rc());
    521 
    522     AutoReadLock alock (this);
     519    AutoCaller autoCaller(this);
     520    CheckComRCReturnRC(autoCaller.rc());
     521
     522    AutoReadLock alock(this);
    523523
    524524    *aIRQ = mData->mIRQ;
     
    537537            mData->mSlot, aIRQ, 255);
    538538
    539     AutoCaller autoCaller (this);
    540     CheckComRCReturnRC (autoCaller.rc());
     539    AutoCaller autoCaller(this);
     540    CheckComRCReturnRC(autoCaller.rc());
    541541
    542542    /* the machine needs to be mutable */
    543543    Machine::AutoMutableStateDependency adep (mParent);
    544     CheckComRCReturnRC (adep.rc());
    545 
    546     AutoWriteLock alock (this);
     544    CheckComRCReturnRC(adep.rc());
     545
     546    AutoWriteLock alock(this);
    547547
    548548    HRESULT rc = S_OK;
     
    571571    CheckComArgOutPointerValid(aIOBase);
    572572
    573     AutoCaller autoCaller (this);
    574     CheckComRCReturnRC (autoCaller.rc());
    575 
    576     AutoReadLock alock (this);
     573    AutoCaller autoCaller(this);
     574    CheckComRCReturnRC(autoCaller.rc());
     575
     576    AutoReadLock alock(this);
    577577
    578578    *aIOBase = mData->mIOBase;
     
    591591            mData->mSlot, aIOBase, 0, 0xFFFF);
    592592
    593     AutoCaller autoCaller (this);
    594     CheckComRCReturnRC (autoCaller.rc());
     593    AutoCaller autoCaller(this);
     594    CheckComRCReturnRC(autoCaller.rc());
    595595
    596596    /* the machine needs to be mutable */
    597597    Machine::AutoMutableStateDependency adep (mParent);
    598     CheckComRCReturnRC (adep.rc());
    599 
    600     AutoWriteLock alock (this);
     598    CheckComRCReturnRC(adep.rc());
     599
     600    AutoWriteLock alock(this);
    601601
    602602    HRESULT rc = S_OK;
     
    625625    CheckComArgOutPointerValid(aPath);
    626626
    627     AutoCaller autoCaller (this);
    628     CheckComRCReturnRC (autoCaller.rc());
    629 
    630     AutoReadLock alock (this);
    631 
    632     mData->mPath.cloneTo (aPath);
     627    AutoCaller autoCaller(this);
     628    CheckComRCReturnRC(autoCaller.rc());
     629
     630    AutoReadLock alock(this);
     631
     632    mData->mPath.cloneTo(aPath);
    633633
    634634    return S_OK;
     
    640640HRESULT SerialPort::checkSetPath (CBSTR aPath)
    641641{
    642     AssertReturn (isWriteLockOnCurrentThread(), E_FAIL);
     642    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
    643643
    644644    if ((mData->mHostMode == PortMode_HostDevice ||
     
    656656STDMETHODIMP SerialPort::COMSETTER(Path) (IN_BSTR aPath)
    657657{
    658     AutoCaller autoCaller (this);
    659     CheckComRCReturnRC (autoCaller.rc());
     658    AutoCaller autoCaller(this);
     659    CheckComRCReturnRC(autoCaller.rc());
    660660
    661661    /* the machine needs to be mutable */
    662662    Machine::AutoMutableStateDependency adep (mParent);
    663     CheckComRCReturnRC (adep.rc());
    664 
    665     AutoWriteLock alock (this);
     663    CheckComRCReturnRC(adep.rc());
     664
     665    AutoWriteLock alock(this);
    666666
    667667    /* we treat empty as null when e.g. saving to XML, do the same here */
     
    672672    {
    673673        HRESULT rc = checkSetPath (aPath);
    674         CheckComRCReturnRC (rc);
     674        CheckComRCReturnRC(rc);
    675675
    676676        mData.backup();
     
    690690    CheckComArgOutPointerValid(aServer);
    691691
    692     AutoCaller autoCaller (this);
    693     CheckComRCReturnRC (autoCaller.rc());
    694 
    695     AutoReadLock alock (this);
     692    AutoCaller autoCaller(this);
     693    CheckComRCReturnRC(autoCaller.rc());
     694
     695    AutoReadLock alock(this);
    696696
    697697    *aServer = mData->mServer;
     
    702702STDMETHODIMP SerialPort::COMSETTER(Server) (BOOL aServer)
    703703{
    704     AutoCaller autoCaller (this);
    705     CheckComRCReturnRC (autoCaller.rc());
     704    AutoCaller autoCaller(this);
     705    CheckComRCReturnRC(autoCaller.rc());
    706706
    707707    /* the machine needs to be mutable */
    708708    Machine::AutoMutableStateDependency adep (mParent);
    709     CheckComRCReturnRC (adep.rc());
    710 
    711     AutoWriteLock alock (this);
     709    CheckComRCReturnRC(adep.rc());
     710
     711    AutoWriteLock alock(this);
    712712
    713713    if (mData->mServer != aServer)
  • trunk/src/VBox/Main/SessionImpl.cpp

    r21697 r21878  
    6262HRESULT Session::FinalConstruct()
    6363{
    64     LogFlowThisFunc (("\n"));
     64    LogFlowThisFunc(("\n"));
    6565
    6666    return init();
     
    6969void Session::FinalRelease()
    7070{
    71     LogFlowThisFunc (("\n"));
     71    LogFlowThisFunc(("\n"));
    7272
    7373    uninit (true /* aFinalRelease */);
     
    8383{
    8484    /* Enclose the state transition NotReady->InInit->Ready */
    85     AutoInitSpan autoInitSpan (this);
    86     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     85    AutoInitSpan autoInitSpan(this);
     86    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    8787
    8888    LogFlowThisFuncEnter();
     
    119119{
    120120    LogFlowThisFuncEnter();
    121     LogFlowThisFunc (("aFinalRelease=%d\n", aFinalRelease));
     121    LogFlowThisFunc(("aFinalRelease=%d\n", aFinalRelease));
    122122
    123123    /* Enclose the state transition Ready->InUninit->NotReady */
    124     AutoUninitSpan autoUninitSpan (this);
     124    AutoUninitSpan autoUninitSpan(this);
    125125    if (autoUninitSpan.uninitDone())
    126126    {
    127         LogFlowThisFunc (("Already uninitialized.\n"));
     127        LogFlowThisFunc(("Already uninitialized.\n"));
    128128        LogFlowThisFuncLeave();
    129129        return;
     
    131131
    132132    /* close() needs write lock */
    133     AutoWriteLock alock (this);
     133    AutoWriteLock alock(this);
    134134
    135135    if (mState != SessionState_Closed)
     
    152152    CheckComArgOutPointerValid(aState);
    153153
    154     AutoCaller autoCaller (this);
    155     CheckComRCReturnRC (autoCaller.rc());
    156 
    157     AutoReadLock alock (this);
     154    AutoCaller autoCaller(this);
     155    CheckComRCReturnRC(autoCaller.rc());
     156
     157    AutoReadLock alock(this);
    158158
    159159    *aState = mState;
     
    166166    CheckComArgOutPointerValid(aType);
    167167
    168     AutoCaller autoCaller (this);
    169     CheckComRCReturnRC (autoCaller.rc());
    170 
    171     AutoReadLock alock (this);
     168    AutoCaller autoCaller(this);
     169    CheckComRCReturnRC(autoCaller.rc());
     170
     171    AutoReadLock alock(this);
    172172
    173173    CHECK_OPEN();
     
    181181    CheckComArgOutPointerValid(aMachine);
    182182
    183     AutoCaller autoCaller (this);
    184     CheckComRCReturnRC (autoCaller.rc());
    185 
    186     AutoReadLock alock (this);
     183    AutoCaller autoCaller(this);
     184    CheckComRCReturnRC(autoCaller.rc());
     185
     186    AutoReadLock alock(this);
    187187
    188188    CHECK_OPEN();
     
    191191
    192192    if (mConsole)
    193         rc = mConsole->machine().queryInterfaceTo (aMachine);
     193        rc = mConsole->machine().queryInterfaceTo(aMachine);
    194194    else
    195         rc = mRemoteMachine.queryInterfaceTo (aMachine);
     195        rc = mRemoteMachine.queryInterfaceTo(aMachine);
    196196    ComAssertComRC (rc);
    197197
     
    203203    CheckComArgOutPointerValid(aConsole);
    204204
    205     AutoCaller autoCaller (this);
    206     CheckComRCReturnRC (autoCaller.rc());
    207 
    208     AutoReadLock alock (this);
     205    AutoCaller autoCaller(this);
     206    CheckComRCReturnRC(autoCaller.rc());
     207
     208    AutoReadLock alock(this);
    209209
    210210    CHECK_OPEN();
     
    213213
    214214    if (mConsole)
    215         rc = mConsole.queryInterfaceTo (aConsole);
     215        rc = mConsole.queryInterfaceTo(aConsole);
    216216    else
    217         rc = mRemoteConsole.queryInterfaceTo (aConsole);
     217        rc = mRemoteConsole.queryInterfaceTo(aConsole);
    218218    ComAssertComRC (rc);
    219219
     
    226226STDMETHODIMP Session::Close()
    227227{
    228     LogFlowThisFunc (("mState=%d, mType=%d\n", mState, mType));
    229 
    230     AutoCaller autoCaller (this);
    231     CheckComRCReturnRC (autoCaller.rc());
     228    LogFlowThisFunc(("mState=%d, mType=%d\n", mState, mType));
     229
     230    AutoCaller autoCaller(this);
     231    CheckComRCReturnRC(autoCaller.rc());
    232232
    233233    /* close() needs write lock */
    234     AutoWriteLock alock (this);
     234    AutoWriteLock alock(this);
    235235
    236236    CHECK_OPEN();
     
    244244STDMETHODIMP Session::GetPID (ULONG *aPid)
    245245{
    246     AssertReturn (aPid, E_POINTER);
    247 
    248     AutoCaller autoCaller (this);
    249     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    250 
    251     AutoReadLock alock (this);
     246    AssertReturn(aPid, E_POINTER);
     247
     248    AutoCaller autoCaller(this);
     249    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     250
     251    AutoReadLock alock(this);
    252252
    253253    *aPid = (ULONG) RTProcSelf();
     
    260260{
    261261    LogFlowThisFuncEnter();
    262     AssertReturn (aConsole, E_POINTER);
    263 
    264     AutoCaller autoCaller (this);
    265     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    266 
    267     AutoReadLock alock (this);
    268 
    269     AssertReturn (mState != SessionState_Closed, VBOX_E_INVALID_VM_STATE);
     262    AssertReturn(aConsole, E_POINTER);
     263
     264    AutoCaller autoCaller(this);
     265    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     266
     267    AutoReadLock alock(this);
     268
     269    AssertReturn(mState != SessionState_Closed, VBOX_E_INVALID_VM_STATE);
    270270
    271271    AssertMsgReturn (mType == SessionType_Direct && !!mConsole,
     
    277277        return VBOX_E_INVALID_VM_STATE;
    278278
    279     mConsole.queryInterfaceTo (aConsole);
     279    mConsole.queryInterfaceTo(aConsole);
    280280
    281281    LogFlowThisFuncLeave();
     
    287287{
    288288    LogFlowThisFuncEnter();
    289     LogFlowThisFunc (("aMachine=%p\n", aMachine));
    290 
    291     AutoCaller autoCaller (this);
    292     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    293 
    294     AutoWriteLock alock (this);
    295 
    296     AssertReturn (mState == SessionState_Closed, VBOX_E_INVALID_VM_STATE);
     289    LogFlowThisFunc(("aMachine=%p\n", aMachine));
     290
     291    AutoCaller autoCaller(this);
     292    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     293
     294    AutoWriteLock alock(this);
     295
     296    AssertReturn(mState == SessionState_Closed, VBOX_E_INVALID_VM_STATE);
    297297
    298298    if (!aMachine)
     
    305305         */
    306306
    307         AssertReturn (mType == SessionType_Null, VBOX_E_INVALID_OBJECT_STATE);
     307        AssertReturn(mType == SessionType_Null, VBOX_E_INVALID_OBJECT_STATE);
    308308        mType = SessionType_Remote;
    309309        mState = SessionState_Spawning;
     
    317317    /* query IInternalMachineControl interface */
    318318    mControl = aMachine;
    319     AssertReturn (!!mControl, E_FAIL);
     319    AssertReturn(!!mControl, E_FAIL);
    320320
    321321    rc = mConsole.createObject();
     
    331331     *  until the session is closed
    332332     */
    333     if (SUCCEEDED (rc))
     333    if (SUCCEEDED(rc))
    334334       rc = aMachine->COMGETTER(Parent) (mVirtualBox.asOutParam());
    335335
    336     if (SUCCEEDED (rc))
     336    if (SUCCEEDED(rc))
    337337    {
    338338        mType = SessionType_Direct;
     
    347347    }
    348348
    349     LogFlowThisFunc (("rc=%08X\n", rc));
     349    LogFlowThisFunc(("rc=%08X\n", rc));
    350350    LogFlowThisFuncLeave();
    351351
     
    356356{
    357357    LogFlowThisFuncEnter();
    358     LogFlowThisFunc (("aMachine=%p, aConsole=%p\n", aMachine, aConsole));
    359 
    360     AssertReturn (aMachine && aConsole, E_INVALIDARG);
    361 
    362     AutoCaller autoCaller (this);
    363     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    364 
    365     AutoWriteLock alock (this);
    366 
    367     AssertReturn (mState == SessionState_Closed ||
     358    LogFlowThisFunc(("aMachine=%p, aConsole=%p\n", aMachine, aConsole));
     359
     360    AssertReturn(aMachine && aConsole, E_INVALIDARG);
     361
     362    AutoCaller autoCaller(this);
     363    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     364
     365    AutoWriteLock alock(this);
     366
     367    AssertReturn(mState == SessionState_Closed ||
    368368                  mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE);
    369369
     
    372372    /* query IInternalMachineControl interface */
    373373    mControl = aMachine;
    374     AssertReturn (!!mControl, E_FAIL); // This test appears to be redundant --JS
     374    AssertReturn(!!mControl, E_FAIL); // This test appears to be redundant --JS
    375375
    376376    /// @todo (dmik)
     
    399399    rc = aMachine->COMGETTER(Parent) (mVirtualBox.asOutParam());
    400400
    401     if (SUCCEEDED (rc))
     401    if (SUCCEEDED(rc))
    402402    {
    403403        /*
     
    420420    }
    421421
    422     LogFlowThisFunc (("rc=%08X\n", rc));
     422    LogFlowThisFunc(("rc=%08X\n", rc));
    423423    LogFlowThisFuncLeave();
    424424
     
    428428STDMETHODIMP Session::UpdateMachineState (MachineState_T aMachineState)
    429429{
    430     AutoCaller autoCaller (this);
     430    AutoCaller autoCaller(this);
    431431
    432432    if (autoCaller.state() != Ready)
     
    436436         *  return silently (not interested in the state change during uninit)
    437437         */
    438         LogFlowThisFunc (("Already uninitialized.\n"));
     438        LogFlowThisFunc(("Already uninitialized.\n"));
    439439        return S_OK;
    440440    }
    441441
    442     AutoReadLock alock (this);
     442    AutoReadLock alock(this);
    443443
    444444    if (mState == SessionState_Closing)
    445445    {
    446         LogFlowThisFunc (("Already being closed.\n"));
     446        LogFlowThisFunc(("Already being closed.\n"));
    447447        return S_OK;
    448448    }
    449449
    450     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    451     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    452 
    453     AssertReturn (!mControl.isNull(), E_FAIL);
    454     AssertReturn (!mConsole.isNull(), E_FAIL);
     450    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     451    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     452
     453    AssertReturn(!mControl.isNull(), E_FAIL);
     454    AssertReturn(!mConsole.isNull(), E_FAIL);
    455455
    456456    return mConsole->updateMachineState (aMachineState);
     
    461461    LogFlowThisFuncEnter();
    462462
    463     AutoCaller autoCaller (this);
     463    AutoCaller autoCaller(this);
    464464
    465465    HRESULT rc = S_OK;
     
    468468    {
    469469        /* close() needs write lock */
    470         AutoWriteLock alock (this);
    471 
    472         LogFlowThisFunc (("mState=%d, mType=%d\n", mState, mType));
     470        AutoWriteLock alock(this);
     471
     472        LogFlowThisFunc(("mState=%d, mType=%d\n", mState, mType));
    473473
    474474        if (mState == SessionState_Closing)
    475475        {
    476             LogFlowThisFunc (("Already being closed.\n"));
     476            LogFlowThisFunc(("Already being closed.\n"));
    477477            return S_OK;
    478478        }
    479479
    480         AssertReturn (mState == SessionState_Open ||
     480        AssertReturn(mState == SessionState_Open ||
    481481                      mState == SessionState_Spawning, VBOX_E_INVALID_VM_STATE);
    482482
     
    490490         *  return silently
    491491         */
    492         LogFlowThisFunc (("Already uninitialized.\n"));
     492        LogFlowThisFunc(("Already uninitialized.\n"));
    493493    }
    494494    else
    495495    {
    496         LogWarningThisFunc (("UNEXPECTED uninitialization!\n"));
     496        LogWarningThisFunc(("UNEXPECTED uninitialization!\n"));
    497497        rc = autoCaller.rc();
    498498    }
    499499
    500     LogFlowThisFunc (("rc=%08X\n", rc));
     500    LogFlowThisFunc(("rc=%08X\n", rc));
    501501    LogFlowThisFuncLeave();
    502502
     
    506506STDMETHODIMP Session::OnDVDDriveChange()
    507507{
    508     LogFlowThisFunc (("\n"));
    509 
    510     AutoCaller autoCaller (this);
    511     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    512 
    513     AutoReadLock alock (this);
    514     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    515     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     508    LogFlowThisFunc(("\n"));
     509
     510    AutoCaller autoCaller(this);
     511    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     512
     513    AutoReadLock alock(this);
     514    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     515    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    516516
    517517    return mConsole->onDVDDriveChange();
     
    520520STDMETHODIMP Session::OnFloppyDriveChange()
    521521{
    522     LogFlowThisFunc (("\n"));
    523 
    524     AutoCaller autoCaller (this);
    525     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    526 
    527     AutoReadLock alock (this);
    528     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    529     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     522    LogFlowThisFunc(("\n"));
     523
     524    AutoCaller autoCaller(this);
     525    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     526
     527    AutoReadLock alock(this);
     528    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     529    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    530530
    531531    return mConsole->onFloppyDriveChange();
     
    534534STDMETHODIMP Session::OnNetworkAdapterChange(INetworkAdapter *networkAdapter)
    535535{
    536     LogFlowThisFunc (("\n"));
    537 
    538     AutoCaller autoCaller (this);
    539     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    540 
    541     AutoReadLock alock (this);
    542     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    543     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     536    LogFlowThisFunc(("\n"));
     537
     538    AutoCaller autoCaller(this);
     539    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     540
     541    AutoReadLock alock(this);
     542    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     543    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    544544
    545545    return mConsole->onNetworkAdapterChange(networkAdapter);
     
    548548STDMETHODIMP Session::OnSerialPortChange(ISerialPort *serialPort)
    549549{
    550     LogFlowThisFunc (("\n"));
    551 
    552     AutoCaller autoCaller (this);
    553     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    554 
    555     AutoReadLock alock (this);
    556     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    557     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     550    LogFlowThisFunc(("\n"));
     551
     552    AutoCaller autoCaller(this);
     553    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     554
     555    AutoReadLock alock(this);
     556    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     557    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    558558
    559559    return mConsole->onSerialPortChange(serialPort);
     
    562562STDMETHODIMP Session::OnParallelPortChange(IParallelPort *parallelPort)
    563563{
    564     LogFlowThisFunc (("\n"));
    565 
    566     AutoCaller autoCaller (this);
    567     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    568 
    569     AutoReadLock alock (this);
    570     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    571     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     564    LogFlowThisFunc(("\n"));
     565
     566    AutoCaller autoCaller(this);
     567    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     568
     569    AutoReadLock alock(this);
     570    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     571    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    572572
    573573    return mConsole->onParallelPortChange(parallelPort);
     
    576576STDMETHODIMP Session::OnStorageControllerChange()
    577577{
    578     LogFlowThisFunc (("\n"));
    579 
    580     AutoCaller autoCaller (this);
    581     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    582 
    583     AutoReadLock alock (this);
    584     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    585     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     578    LogFlowThisFunc(("\n"));
     579
     580    AutoCaller autoCaller(this);
     581    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     582
     583    AutoReadLock alock(this);
     584    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     585    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    586586
    587587    return mConsole->onStorageControllerChange();
     
    590590STDMETHODIMP Session::OnVRDPServerChange()
    591591{
    592     LogFlowThisFunc (("\n"));
    593 
    594     AutoCaller autoCaller (this);
    595     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    596 
    597     AutoReadLock alock (this);
    598     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    599     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     592    LogFlowThisFunc(("\n"));
     593
     594    AutoCaller autoCaller(this);
     595    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     596
     597    AutoReadLock alock(this);
     598    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     599    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    600600
    601601    return mConsole->onVRDPServerChange();
     
    604604STDMETHODIMP Session::OnUSBControllerChange()
    605605{
    606     LogFlowThisFunc (("\n"));
    607 
    608     AutoCaller autoCaller (this);
    609     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    610 
    611     AutoReadLock alock (this);
    612     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    613     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     606    LogFlowThisFunc(("\n"));
     607
     608    AutoCaller autoCaller(this);
     609    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     610
     611    AutoReadLock alock(this);
     612    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     613    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    614614
    615615    return mConsole->onUSBControllerChange();
     
    618618STDMETHODIMP Session::OnSharedFolderChange (BOOL aGlobal)
    619619{
    620     LogFlowThisFunc (("\n"));
    621 
    622     AutoCaller autoCaller (this);
    623     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    624 
    625     AutoReadLock alock (this);
    626     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    627     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     620    LogFlowThisFunc(("\n"));
     621
     622    AutoCaller autoCaller(this);
     623    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     624
     625    AutoReadLock alock(this);
     626    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     627    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    628628
    629629    return mConsole->onSharedFolderChange (aGlobal);
     
    634634                                         ULONG aMaskedIfs)
    635635{
    636     LogFlowThisFunc (("\n"));
    637 
    638     AutoCaller autoCaller (this);
    639     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    640 
    641     AutoReadLock alock (this);
    642     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    643     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     636    LogFlowThisFunc(("\n"));
     637
     638    AutoCaller autoCaller(this);
     639    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     640
     641    AutoReadLock alock(this);
     642    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     643    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    644644
    645645    return mConsole->onUSBDeviceAttach (aDevice, aError, aMaskedIfs);
     
    649649                                         IVirtualBoxErrorInfo *aError)
    650650{
    651     LogFlowThisFunc (("\n"));
    652 
    653     AutoCaller autoCaller (this);
    654     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    655 
    656     AutoReadLock alock (this);
    657     AssertReturn (mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
    658     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     651    LogFlowThisFunc(("\n"));
     652
     653    AutoCaller autoCaller(this);
     654    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     655
     656    AutoReadLock alock(this);
     657    AssertReturn(mState == SessionState_Open, VBOX_E_INVALID_VM_STATE);
     658    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    659659
    660660    return mConsole->onUSBDeviceDetach (aId, aError);
     
    663663STDMETHODIMP Session::OnShowWindow (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId)
    664664{
    665     AutoCaller autoCaller (this);
    666     AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    667 
    668     AutoReadLock alock (this);
    669 
    670     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     665    AutoCaller autoCaller(this);
     666    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     667
     668    AutoReadLock alock(this);
     669
     670    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    671671
    672672    if (mState != SessionState_Open)
     
    688688{
    689689#ifdef VBOX_WITH_GUEST_PROPS
    690     AutoCaller autoCaller (this);
     690    AutoCaller autoCaller(this);
    691691    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    692692
     
    695695            tr ("Machine session is not open (session state: %d)."),
    696696            mState);
    697     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     697    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    698698    CheckComArgNotNull(aName);
    699699    if (!aIsSetter && !VALID_PTR (aRetValue))
     
    725725{
    726726#ifdef VBOX_WITH_GUEST_PROPS
    727     AutoCaller autoCaller (this);
     727    AutoCaller autoCaller(this);
    728728    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    729729
     
    732732            tr ("Machine session is not open (session state: %d)."),
    733733            mState);
    734     AssertReturn (mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
     734    AssertReturn(mType == SessionType_Direct, VBOX_E_INVALID_OBJECT_STATE);
    735735    if (!VALID_PTR (aPatterns) && (aPatterns != NULL))
    736736        return E_POINTER;
    737     if (ComSafeArrayOutIsNull (aNames))
     737    if (ComSafeArrayOutIsNull(aNames))
    738738        return E_POINTER;
    739     if (ComSafeArrayOutIsNull (aValues))
     739    if (ComSafeArrayOutIsNull(aValues))
    740740        return E_POINTER;
    741     if (ComSafeArrayOutIsNull (aTimestamps))
     741    if (ComSafeArrayOutIsNull(aTimestamps))
    742742        return E_POINTER;
    743     if (ComSafeArrayOutIsNull (aFlags))
     743    if (ComSafeArrayOutIsNull(aFlags))
    744744        return E_POINTER;
    745745    return mConsole->enumerateGuestProperties(aPatterns,
     
    768768{
    769769    LogFlowThisFuncEnter();
    770     LogFlowThisFunc (("aFinalRelease=%d, isFromServer=%d\n",
     770    LogFlowThisFunc(("aFinalRelease=%d, isFromServer=%d\n",
    771771                      aFinalRelease, aFromServer));
    772772
    773     AutoCaller autoCaller (this);
    774     AssertComRCReturnRC (autoCaller.rc());
    775 
    776     AutoWriteLock alock (this);
    777 
    778     LogFlowThisFunc (("mState=%d, mType=%d\n", mState, mType));
     773    AutoCaller autoCaller(this);
     774    AssertComRCReturnRC(autoCaller.rc());
     775
     776    AutoWriteLock alock(this);
     777
     778    LogFlowThisFunc(("mState=%d, mType=%d\n", mState, mType));
    779779
    780780    if (mState != SessionState_Open)
     
    822822    }
    823823
    824     ComPtr <IProgress> progress;
     824    ComPtr<IProgress> progress;
    825825
    826826    if (!aFinalRelease && !aFromServer)
     
    845845        alock.leave();
    846846
    847         LogFlowThisFunc (("Calling mControl->OnSessionEnd()...\n"));
     847        LogFlowThisFunc(("Calling mControl->OnSessionEnd()...\n"));
    848848        HRESULT rc = mControl->OnSessionEnd (this, progress.asOutParam());
    849         LogFlowThisFunc (("mControl->OnSessionEnd()=%08X\n", rc));
     849        LogFlowThisFunc(("mControl->OnSessionEnd()=%08X\n", rc));
    850850
    851851        alock.enter();
     
    897897    Bstr ipcId;
    898898    rc = mControl->GetIPCId (ipcId.asOutParam());
    899     AssertComRCReturnRC (rc);
    900 
    901     LogFlowThisFunc (("ipcId='%ls'\n", ipcId.raw()));
     899    AssertComRCReturnRC(rc);
     900
     901    LogFlowThisFunc(("ipcId='%ls'\n", ipcId.raw()));
    902902
    903903#if defined(RT_OS_WINDOWS)
     
    966966    /* wait until thread init is completed */
    967967    vrc = RTThreadUserWait (mIPCThread, RT_INDEFINITE_WAIT);
    968     AssertReturn (RT_SUCCESS (vrc) || vrc == VERR_INTERRUPTED, E_FAIL);
     968    AssertReturn(RT_SUCCESS(vrc) || vrc == VERR_INTERRUPTED, E_FAIL);
    969969
    970970    /* the thread must succeed */
    971     AssertReturn ((bool) data [2], E_FAIL);
     971    AssertReturn((bool) data [2], E_FAIL);
    972972
    973973#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
     
    10391039        /* wait for the thread to finish */
    10401040        vrc = RTThreadUserWait (mIPCThread, RT_INDEFINITE_WAIT);
    1041         Assert (RT_SUCCESS (vrc) || vrc == VERR_INTERRUPTED);
     1041        Assert (RT_SUCCESS(vrc) || vrc == VERR_INTERRUPTED);
    10421042
    10431043        mIPCThread = NIL_RTTHREAD;
  • trunk/src/VBox/Main/SharedFolderImpl.cpp

    r21079 r21878  
    7070{
    7171    /* Enclose the state transition NotReady->InInit->Ready */
    72     AutoInitSpan autoInitSpan (this);
    73     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    74 
    75     unconst (mMachine) = aMachine;
     72    AutoInitSpan autoInitSpan(this);
     73    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     74
     75    unconst(mMachine) = aMachine;
    7676
    7777    HRESULT rc = protectedInit (aMachine, aName, aHostPath, aWritable);
    7878
    7979    /* Confirm a successful initialization when it's the case */
    80     if (SUCCEEDED (rc))
     80    if (SUCCEEDED(rc))
    8181        autoInitSpan.setSucceeded();
    8282
     
    9999
    100100    /* Enclose the state transition NotReady->InInit->Ready */
    101     AutoInitSpan autoInitSpan (this);
    102     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    103 
    104     unconst (mMachine) = aMachine;
     101    AutoInitSpan autoInitSpan(this);
     102    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     103
     104    unconst(mMachine) = aMachine;
    105105
    106106    HRESULT rc = protectedInit (aMachine, aThat->m.name,
     
    108108
    109109    /* Confirm a successful initialization when it's the case */
    110     if (SUCCEEDED (rc))
     110    if (SUCCEEDED(rc))
    111111        autoInitSpan.setSucceeded();
    112112
     
    128128{
    129129    /* Enclose the state transition NotReady->InInit->Ready */
    130     AutoInitSpan autoInitSpan (this);
    131     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    132 
    133     unconst (mConsole) = aConsole;
     130    AutoInitSpan autoInitSpan(this);
     131    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     132
     133    unconst(mConsole) = aConsole;
    134134
    135135    HRESULT rc = protectedInit (aConsole, aName, aHostPath, aWritable);
    136136
    137137    /* Confirm a successful initialization when it's the case */
    138     if (SUCCEEDED (rc))
     138    if (SUCCEEDED(rc))
    139139        autoInitSpan.setSucceeded();
    140140
     
    156156{
    157157    /* Enclose the state transition NotReady->InInit->Ready */
    158     AutoInitSpan autoInitSpan (this);
    159     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    160 
    161     unconst (mVirtualBox) = aVirtualBox;
     158    AutoInitSpan autoInitSpan(this);
     159    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     160
     161    unconst(mVirtualBox) = aVirtualBox;
    162162
    163163    HRESULT rc = protectedInit (aVirtualBox, aName, aHostPath, aWritable);
    164164
    165165    /* Confirm a successful initialization when it's the case */
    166     if (SUCCEEDED (rc))
     166    if (SUCCEEDED(rc))
    167167        autoInitSpan.setSucceeded();
    168168
     
    179179                                     CBSTR aName, CBSTR aHostPath, BOOL aWritable)
    180180{
    181     LogFlowThisFunc (("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n",
     181    LogFlowThisFunc(("aName={%ls}, aHostPath={%ls}, aWritable={%d}\n",
    182182                      aName, aHostPath, aWritable));
    183183
     
    209209    int vrc = RTPathAbsEx (NULL, hostPath,
    210210                           hostPathFull, sizeof (hostPathFull));
    211     if (RT_FAILURE (vrc))
     211    if (RT_FAILURE(vrc))
    212212        return setError (E_INVALIDARG,
    213213            tr ("Invalid shared folder path: '%s' (%Rrc)"), hostPath.raw(), vrc);
     
    217217            tr ("Shared folder path '%s' is not absolute"), hostPath.raw());
    218218
    219     unconst (mParent) = aParent;
     219    unconst(mParent) = aParent;
    220220
    221221    /* register with parent */
    222222    mParent->addDependentChild (this);
    223223
    224     unconst (m.name) = aName;
    225     unconst (m.hostPath) = hostPath;
     224    unconst(m.name) = aName;
     225    unconst(m.hostPath) = hostPath;
    226226    m.writable = aWritable;
    227227
     
    235235void SharedFolder::uninit()
    236236{
    237     LogFlowThisFunc (("\n"));
     237    LogFlowThisFunc(("\n"));
    238238
    239239    /* Enclose the state transition Ready->InUninit->NotReady */
    240     AutoUninitSpan autoUninitSpan (this);
     240    AutoUninitSpan autoUninitSpan(this);
    241241    if (autoUninitSpan.uninitDone())
    242242        return;
     
    245245        mParent->removeDependentChild (this);
    246246
    247     unconst (mParent) = NULL;
    248 
    249     unconst (mMachine).setNull();
    250     unconst (mConsole).setNull();
    251     unconst (mVirtualBox).setNull();
     247    unconst(mParent) = NULL;
     248
     249    unconst(mMachine).setNull();
     250    unconst(mConsole).setNull();
     251    unconst(mVirtualBox).setNull();
    252252}
    253253
     
    259259    CheckComArgOutPointerValid(aName);
    260260
    261     AutoCaller autoCaller (this);
    262     CheckComRCReturnRC (autoCaller.rc());
     261    AutoCaller autoCaller(this);
     262    CheckComRCReturnRC(autoCaller.rc());
    263263
    264264    /* mName is constant during life time, no need to lock */
    265     m.name.cloneTo (aName);
     265    m.name.cloneTo(aName);
    266266
    267267    return S_OK;
     
    272272    CheckComArgOutPointerValid(aHostPath);
    273273
    274     AutoCaller autoCaller (this);
    275     CheckComRCReturnRC (autoCaller.rc());
     274    AutoCaller autoCaller(this);
     275    CheckComRCReturnRC(autoCaller.rc());
    276276
    277277    /* mHostPath is constant during life time, no need to lock */
    278     m.hostPath.cloneTo (aHostPath);
     278    m.hostPath.cloneTo(aHostPath);
    279279
    280280    return S_OK;
     
    283283STDMETHODIMP SharedFolder::COMGETTER(Accessible) (BOOL *aAccessible)
    284284{
    285     CheckComArgOutPointerValid (aAccessible);
    286 
    287     AutoCaller autoCaller (this);
    288     CheckComRCReturnRC (autoCaller.rc());
     285    CheckComArgOutPointerValid(aAccessible);
     286
     287    AutoCaller autoCaller(this);
     288    CheckComRCReturnRC(autoCaller.rc());
    289289
    290290    /* mName and mHostPath are constant during life time, no need to lock */
     
    296296                                                    sizeof (hostPathFull))
    297297                                      : VERR_PATH_NOT_FOUND;
    298     if (RT_SUCCESS (vrc))
     298    if (RT_SUCCESS(vrc))
    299299    {
    300300        *aAccessible = TRUE;
     
    302302    }
    303303
    304     AutoWriteLock alock (this);
     304    AutoWriteLock alock(this);
    305305
    306306    m.lastAccessError = BstrFmt (
    307307        tr ("'%s' is not accessible (%Rrc)"), hostPath.raw(), vrc);
    308308
    309     LogWarningThisFunc (("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw()));
     309    LogWarningThisFunc(("m.lastAccessError=\"%ls\"\n", m.lastAccessError.raw()));
    310310
    311311    *aAccessible = FALSE;
     
    324324STDMETHODIMP SharedFolder::COMGETTER(LastAccessError) (BSTR *aLastAccessError)
    325325{
    326     CheckComArgOutPointerValid (aLastAccessError);
    327 
    328     AutoCaller autoCaller (this);
    329     CheckComRCReturnRC (autoCaller.rc());
    330 
    331     AutoReadLock alock (this);
     326    CheckComArgOutPointerValid(aLastAccessError);
     327
     328    AutoCaller autoCaller(this);
     329    CheckComRCReturnRC(autoCaller.rc());
     330
     331    AutoReadLock alock(this);
    332332
    333333    if (m.lastAccessError.isEmpty())
    334334        Bstr("").cloneTo(aLastAccessError);
    335335    else
    336         m.lastAccessError.cloneTo (aLastAccessError);
     336        m.lastAccessError.cloneTo(aLastAccessError);
    337337
    338338    return S_OK;
  • trunk/src/VBox/Main/SnapshotImpl.cpp

    r21835 r21878  
    130130
    131131    /* Enclose the state transition Ready->InUninit->NotReady */
    132     AutoUninitSpan autoUninitSpan (this);
     132    AutoUninitSpan autoUninitSpan(this);
    133133    if (autoUninitSpan.uninitDone())
    134134        return;
     
    251251    CheckComRCReturnRC(autoCaller.rc());
    252252
    253     AutoReadLock alock (this);
     253    AutoReadLock alock(this);
    254254
    255255    m->id.toUtf16().cloneTo(aId);
     
    264264    CheckComRCReturnRC(autoCaller.rc());
    265265
    266     AutoReadLock alock (this);
     266    AutoReadLock alock(this);
    267267
    268268    m->name.cloneTo(aName);
     
    302302    CheckComRCReturnRC(autoCaller.rc());
    303303
    304     AutoReadLock alock (this);
     304    AutoReadLock alock(this);
    305305
    306306    m->description.cloneTo(aDescription);
     
    336336    CheckComRCReturnRC(autoCaller.rc());
    337337
    338     AutoReadLock alock (this);
     338    AutoReadLock alock(this);
    339339
    340340    *aTimeStamp = RTTimeSpecGetMilli(&m->timeStamp);
     
    349349    CheckComRCReturnRC(autoCaller.rc());
    350350
    351     AutoReadLock alock (this);
     351    AutoReadLock alock(this);
    352352
    353353    *aOnline = !stateFilePath().isNull();
     
    362362    CheckComRCReturnRC(autoCaller.rc());
    363363
    364     AutoReadLock alock (this);
     364    AutoReadLock alock(this);
    365365
    366366    m->pMachine.queryInterfaceTo(aMachine);
     
    375375    CheckComRCReturnRC(autoCaller.rc());
    376376
    377     AutoReadLock alock (this);
    378 
    379     mParent.queryInterfaceTo (aParent);
    380     return S_OK;
    381 }
    382 
    383 STDMETHODIMP Snapshot::COMGETTER(Children) (ComSafeArrayOut (ISnapshot *, aChildren))
     377    AutoReadLock alock(this);
     378
     379    mParent.queryInterfaceTo(aParent);
     380    return S_OK;
     381}
     382
     383STDMETHODIMP Snapshot::COMGETTER(Children) (ComSafeArrayOut(ISnapshot *, aChildren))
    384384{
    385385    CheckComArgOutSafeArrayPointerValid(aChildren);
     
    537537ComObjPtr<Snapshot> Snapshot::findChildOrSelf(IN_BSTR aName)
    538538{
    539     ComObjPtr <Snapshot> child;
    540     AssertReturn (aName, child);
     539    ComObjPtr<Snapshot> child;
     540    AssertReturn(aName, child);
    541541
    542542    AutoCaller autoCaller(this);
    543543    AssertComRC(autoCaller.rc());
    544544
    545     AutoReadLock alock (this);
     545    AutoReadLock alock(this);
    546546
    547547    if (m->name == aName)
     
    673673            Key hwNode = aNode.createKey ("Hardware");
    674674            HRESULT rc = snapshotMachine->saveHardware(hwNode);
    675             CheckComRCReturnRC (rc);
     675            CheckComRCReturnRC(rc);
    676676        }
    677677
     
    680680            Key storageNode = aNode.createKey ("StorageControllers");
    681681            HRESULT rc = snapshotMachine->saveStorageControllers(storageNode);
    682             CheckComRCReturnRC (rc);
     682            CheckComRCReturnRC(rc);
    683683        }
    684684    }
     
    698698            Key snapshotNode = snapshotsNode.createKey("Snapshot");
    699699            rc = (*it)->saveSnapshotImpl(snapshotNode, aAttrsOnly);
    700             CheckComRCReturnRC (rc);
     700            CheckComRCReturnRC(rc);
    701701        }
    702702    }
  • trunk/src/VBox/Main/StorageControllerImpl.cpp

    r17768 r21878  
    6666                                 StorageBus_T aStorageBus)
    6767{
    68     LogFlowThisFunc (("aParent=%p aName=\"%ls\"\n", aParent, aName));
     68    LogFlowThisFunc(("aParent=%p aName=\"%ls\"\n", aParent, aName));
    6969
    7070    ComAssertRet (aParent && aName, E_INVALIDARG);
     
    7575
    7676    /* Enclose the state transition NotReady->InInit->Ready */
    77     AutoInitSpan autoInitSpan (this);
    78     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    79 
    80     unconst (mParent) = aParent;
     77    AutoInitSpan autoInitSpan(this);
     78    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     79
     80    unconst(mParent) = aParent;
    8181    /* mPeer is left null */
    8282
     
    132132                                 bool aReshare /* = false */)
    133133{
    134     LogFlowThisFunc (("aParent=%p, aThat=%p, aReshare=%RTbool\n",
     134    LogFlowThisFunc(("aParent=%p, aThat=%p, aReshare=%RTbool\n",
    135135                      aParent, aThat, aReshare));
    136136
     
    138138
    139139    /* Enclose the state transition NotReady->InInit->Ready */
    140     AutoInitSpan autoInitSpan (this);
    141     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    142 
    143     unconst (mParent) = aParent;
     140    AutoInitSpan autoInitSpan(this);
     141    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     142
     143    unconst(mParent) = aParent;
    144144
    145145    /* register with parent early, since uninit() will unconditionally
     
    149149    /* sanity */
    150150    AutoCaller thatCaller (aThat);
    151     AssertComRCReturnRC (thatCaller.rc());
     151    AssertComRCReturnRC(thatCaller.rc());
    152152
    153153    if (aReshare)
     
    155155        AutoWriteLock thatLock (aThat);
    156156
    157         unconst (aThat->mPeer) = this;
     157        unconst(aThat->mPeer) = this;
    158158        mData.attach (aThat->mData);
    159159    }
    160160    else
    161161    {
    162         unconst (mPeer) = aThat;
     162        unconst(mPeer) = aThat;
    163163
    164164        AutoReadLock thatLock (aThat);
     
    179179HRESULT StorageController::initCopy (Machine *aParent, StorageController *aThat)
    180180{
    181     LogFlowThisFunc (("aParent=%p, aThat=%p\n", aParent, aThat));
     181    LogFlowThisFunc(("aParent=%p, aThat=%p\n", aParent, aThat));
    182182
    183183    ComAssertRet (aParent && aThat, E_INVALIDARG);
    184184
    185185    /* Enclose the state transition NotReady->InInit->Ready */
    186     AutoInitSpan autoInitSpan (this);
    187     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    188 
    189     unconst (mParent) = aParent;
     186    AutoInitSpan autoInitSpan(this);
     187    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     188
     189    unconst(mParent) = aParent;
    190190    /* mPeer is left null */
    191191
     
    193193
    194194    AutoCaller thatCaller (aThat);
    195     AssertComRCReturnRC (thatCaller.rc());
     195    AssertComRCReturnRC(thatCaller.rc());
    196196
    197197    AutoReadLock thatlock (aThat);
     
    211211void StorageController::uninit()
    212212{
    213     LogFlowThisFunc (("\n"));
     213    LogFlowThisFunc(("\n"));
    214214
    215215    /* Enclose the state transition Ready->InUninit->NotReady */
    216     AutoUninitSpan autoUninitSpan (this);
     216    AutoUninitSpan autoUninitSpan(this);
    217217    if (autoUninitSpan.uninitDone())
    218218        return;
     
    222222    mParent->removeDependentChild (this);
    223223
    224     unconst (mPeer).setNull();
    225     unconst (mParent).setNull();
     224    unconst(mPeer).setNull();
     225    unconst(mParent).setNull();
    226226}
    227227
     
    233233    CheckComArgOutPointerValid(aName);
    234234
    235     AutoCaller autoCaller (this);
    236     CheckComRCReturnRC (autoCaller.rc());
     235    AutoCaller autoCaller(this);
     236    CheckComRCReturnRC(autoCaller.rc());
    237237
    238238    /* mName is constant during life time, no need to lock */
    239     mData.data()->mName.cloneTo (aName);
     239    mData.data()->mName.cloneTo(aName);
    240240
    241241    return S_OK;
     
    246246    CheckComArgOutPointerValid(aBus);
    247247
    248     AutoCaller autoCaller (this);
    249     CheckComRCReturnRC (autoCaller.rc());
    250 
    251     AutoReadLock alock (this);
     248    AutoCaller autoCaller(this);
     249    CheckComRCReturnRC(autoCaller.rc());
     250
     251    AutoReadLock alock(this);
    252252
    253253    *aBus = mData->mStorageBus;
     
    260260    CheckComArgOutPointerValid(aControllerType);
    261261
    262     AutoCaller autoCaller (this);
    263     CheckComRCReturnRC (autoCaller.rc());
    264 
    265     AutoReadLock alock (this);
     262    AutoCaller autoCaller(this);
     263    CheckComRCReturnRC(autoCaller.rc());
     264
     265    AutoReadLock alock(this);
    266266
    267267    *aControllerType = mData->mStorageControllerType;
     
    272272STDMETHODIMP StorageController::COMSETTER(ControllerType) (StorageControllerType_T aControllerType)
    273273{
    274     AutoCaller autoCaller (this);
    275     CheckComRCReturnRC (autoCaller.rc());
    276 
    277     AutoWriteLock alock (this);
     274    AutoCaller autoCaller(this);
     275    CheckComRCReturnRC(autoCaller.rc());
     276
     277    AutoWriteLock alock(this);
    278278
    279279    HRESULT rc = S_OK;
     
    306306    }
    307307
    308     if (!SUCCEEDED (rc))
     308    if (!SUCCEEDED(rc))
    309309        return setError(rc,
    310310                        tr ("Invalid controller type %d"),
     
    320320    CheckComArgOutPointerValid(aMaxDevices);
    321321
    322     AutoCaller autoCaller (this);
    323     CheckComRCReturnRC (autoCaller.rc());
    324 
    325     AutoReadLock alock (this);
     322    AutoCaller autoCaller(this);
     323    CheckComRCReturnRC(autoCaller.rc());
     324
     325    AutoReadLock alock(this);
    326326
    327327    switch (mData->mStorageBus)
     
    351351    CheckComArgOutPointerValid(aMinPortCount);
    352352
    353     AutoCaller autoCaller (this);
    354     CheckComRCReturnRC (autoCaller.rc());
    355 
    356     AutoReadLock alock (this);
     353    AutoCaller autoCaller(this);
     354    CheckComRCReturnRC(autoCaller.rc());
     355
     356    AutoReadLock alock(this);
    357357
    358358    switch (mData->mStorageBus)
     
    384384    CheckComArgOutPointerValid(aMaxPortCount);
    385385
    386     AutoCaller autoCaller (this);
    387     CheckComRCReturnRC (autoCaller.rc());
    388 
    389     AutoReadLock alock (this);
     386    AutoCaller autoCaller(this);
     387    CheckComRCReturnRC(autoCaller.rc());
     388
     389    AutoReadLock alock(this);
    390390
    391391    switch (mData->mStorageBus)
     
    418418    CheckComArgOutPointerValid(aPortCount);
    419419
    420     AutoCaller autoCaller (this);
    421     CheckComRCReturnRC (autoCaller.rc());
    422 
    423     AutoReadLock alock (this);
     420    AutoCaller autoCaller(this);
     421    CheckComRCReturnRC(autoCaller.rc());
     422
     423    AutoReadLock alock(this);
    424424
    425425    *aPortCount = mData->mPortCount;
     
    431431STDMETHODIMP StorageController::COMSETTER(PortCount) (ULONG aPortCount)
    432432{
    433     LogFlowThisFunc (("aPortCount=%u\n", aPortCount));
     433    LogFlowThisFunc(("aPortCount=%u\n", aPortCount));
    434434
    435435    switch (mData->mStorageBus)
     
    473473    }
    474474
    475     AutoCaller autoCaller (this);
    476     CheckComRCReturnRC (autoCaller.rc());
     475    AutoCaller autoCaller(this);
     476    CheckComRCReturnRC(autoCaller.rc());
    477477
    478478    /* the machine needs to be mutable */
    479479    Machine::AutoMutableStateDependency adep (mParent);
    480     CheckComRCReturnRC (adep.rc());
    481 
    482     AutoWriteLock alock (this);
     480    CheckComRCReturnRC(adep.rc());
     481
     482    AutoWriteLock alock(this);
    483483
    484484    if (mData->mPortCount != aPortCount)
     
    498498STDMETHODIMP StorageController::COMGETTER(Instance) (ULONG *aInstance)
    499499{
    500     AutoCaller autoCaller (this);
    501     CheckComRCReturnRC (autoCaller.rc());
     500    AutoCaller autoCaller(this);
     501    CheckComRCReturnRC(autoCaller.rc());
    502502
    503503    /* The machine doesn't need to be mutable. */
    504504
    505     AutoReadLock alock (this);
     505    AutoReadLock alock(this);
    506506
    507507    *aInstance = mInstance;
     
    512512STDMETHODIMP StorageController::COMSETTER(Instance) (ULONG aInstance)
    513513{
    514     AutoCaller autoCaller (this);
    515     CheckComRCReturnRC (autoCaller.rc());
     514    AutoCaller autoCaller(this);
     515    CheckComRCReturnRC(autoCaller.rc());
    516516
    517517    /* The machine doesn't need to be mutable. */
    518518
    519     AutoWriteLock alock (this);
     519    AutoWriteLock alock(this);
    520520
    521521    mInstance = aInstance;
     
    531531    CheckComArgOutPointerValid(aPortNumber);
    532532
    533     AutoCaller autoCaller (this);
    534     CheckComRCReturnRC (autoCaller.rc());
    535 
    536     AutoReadLock alock (this);
     533    AutoCaller autoCaller(this);
     534    CheckComRCReturnRC(autoCaller.rc());
     535
     536    AutoReadLock alock(this);
    537537
    538538    if (mData->mStorageControllerType != StorageControllerType_IntelAhci)
     
    563563STDMETHODIMP StorageController::SetIDEEmulationPort(LONG DevicePosition, LONG aPortNumber)
    564564{
    565     AutoCaller autoCaller (this);
    566     CheckComRCReturnRC (autoCaller.rc());
     565    AutoCaller autoCaller(this);
     566    CheckComRCReturnRC(autoCaller.rc());
    567567
    568568    /* the machine needs to be mutable */
    569569    Machine::AutoMutableStateDependency adep (mParent);
    570     CheckComRCReturnRC (adep.rc());
    571     AutoWriteLock alock (this);
     570    CheckComRCReturnRC(adep.rc());
     571    AutoWriteLock alock(this);
    572572
    573573    if (mData->mStorageControllerType != StorageControllerType_IntelAhci)
     
    607607bool StorageController::rollback()
    608608{
    609     AutoCaller autoCaller (this);
     609    AutoCaller autoCaller(this);
    610610    AssertComRCReturn (autoCaller.rc(), false);
    611611
    612     AutoWriteLock alock (this);
     612    AutoWriteLock alock(this);
    613613
    614614    bool dataChanged = false;
     
    632632{
    633633    /* sanity */
    634     AutoCaller autoCaller (this);
     634    AutoCaller autoCaller(this);
    635635    AssertComRCReturnVoid (autoCaller.rc());
    636636
     
    664664{
    665665    /* sanity */
    666     AutoCaller autoCaller (this);
     666    AutoCaller autoCaller(this);
    667667    AssertComRCReturnVoid (autoCaller.rc());
    668668
     
    683683    }
    684684
    685     unconst (mPeer).setNull();
     685    unconst(mPeer).setNull();
    686686}
    687687
  • trunk/src/VBox/Main/SystemPropertiesImpl.cpp

    r21446 r21878  
    6767HRESULT SystemProperties::init (VirtualBox *aParent)
    6868{
    69     LogFlowThisFunc (("aParent=%p\n", aParent));
     69    LogFlowThisFunc(("aParent=%p\n", aParent));
    7070
    7171    ComAssertRet (aParent, E_FAIL);
    7272
    7373    /* Enclose the state transition NotReady->InInit->Ready */
    74     AutoInitSpan autoInitSpan (this);
    75     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    76 
    77     unconst (mParent) = aParent;
     74    AutoInitSpan autoInitSpan(this);
     75    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     76
     77    unconst(mParent) = aParent;
    7878
    7979    setDefaultMachineFolder (NULL);
     
    9999    int vrc = VDBackendInfo (RT_ELEMENTS (aVDInfo), aVDInfo, &cEntries);
    100100    AssertRC (vrc);
    101     if (RT_SUCCESS (vrc))
     101    if (RT_SUCCESS(vrc))
    102102    {
    103103        for (unsigned i = 0; i < cEntries; ++ i)
    104104        {
    105             ComObjPtr <HardDiskFormat> hdf;
     105            ComObjPtr<HardDiskFormat> hdf;
    106106            rc = hdf.createObject();
    107107            CheckComRCBreakRC (rc);
     
    149149
    150150    /* Confirm a successful initialization */
    151     if (SUCCEEDED (rc))
     151    if (SUCCEEDED(rc))
    152152        autoInitSpan.setSucceeded();
    153153
     
    161161void SystemProperties::uninit()
    162162{
    163     LogFlowThisFunc (("\n"));
     163    LogFlowThisFunc(("\n"));
    164164
    165165    /* Enclose the state transition Ready->InUninit->NotReady */
    166     AutoUninitSpan autoUninitSpan (this);
     166    AutoUninitSpan autoUninitSpan(this);
    167167    if (autoUninitSpan.uninitDone())
    168168        return;
    169169
    170     unconst (mParent).setNull();
     170    unconst(mParent).setNull();
    171171}
    172172
     
    180180        return E_POINTER;
    181181
    182     AutoCaller autoCaller (this);
    183     CheckComRCReturnRC (autoCaller.rc());
     182    AutoCaller autoCaller(this);
     183    CheckComRCReturnRC(autoCaller.rc());
    184184
    185185    /* no need to lock, this is const */
     
    195195        return E_POINTER;
    196196
    197     AutoCaller autoCaller (this);
    198     CheckComRCReturnRC (autoCaller.rc());
     197    AutoCaller autoCaller(this);
     198    CheckComRCReturnRC(autoCaller.rc());
    199199
    200200    /* no need to lock, this is const */
     
    210210        return E_POINTER;
    211211
    212     AutoCaller autoCaller (this);
    213     CheckComRCReturnRC (autoCaller.rc());
     212    AutoCaller autoCaller(this);
     213    CheckComRCReturnRC(autoCaller.rc());
    214214
    215215    /* no need to lock, this is const */
     
    224224        return E_POINTER;
    225225
    226     AutoCaller autoCaller (this);
    227     CheckComRCReturnRC (autoCaller.rc());
     226    AutoCaller autoCaller(this);
     227    CheckComRCReturnRC(autoCaller.rc());
    228228
    229229    /* no need to lock, this is const */
     
    238238        return E_POINTER;
    239239
    240     AutoCaller autoCaller (this);
    241     CheckComRCReturnRC (autoCaller.rc());
     240    AutoCaller autoCaller(this);
     241    CheckComRCReturnRC(autoCaller.rc());
    242242
    243243    /* no need to lock, this is const */
     
    252252        return E_POINTER;
    253253
    254     AutoCaller autoCaller (this);
    255     CheckComRCReturnRC (autoCaller.rc());
     254    AutoCaller autoCaller(this);
     255    CheckComRCReturnRC(autoCaller.rc());
    256256
    257257    /* no need to lock, this is const */
     
    266266        return E_POINTER;
    267267
    268     AutoCaller autoCaller (this);
    269     CheckComRCReturnRC (autoCaller.rc());
     268    AutoCaller autoCaller(this);
     269    CheckComRCReturnRC(autoCaller.rc());
    270270
    271271    /* no need to lock, this is const */
     
    280280        return E_POINTER;
    281281
    282     AutoCaller autoCaller (this);
    283     CheckComRCReturnRC (autoCaller.rc());
     282    AutoCaller autoCaller(this);
     283    CheckComRCReturnRC(autoCaller.rc());
    284284
    285285    /** The BIOS supports currently 32 bit LBA numbers (implementing the full
     
    303303        return E_POINTER;
    304304
    305     AutoCaller autoCaller (this);
    306     CheckComRCReturnRC (autoCaller.rc());
     305    AutoCaller autoCaller(this);
     306    CheckComRCReturnRC(autoCaller.rc());
    307307
    308308    /* no need to lock, this is const */
     
    317317        return E_POINTER;
    318318
    319     AutoCaller autoCaller (this);
    320     CheckComRCReturnRC (autoCaller.rc());
     319    AutoCaller autoCaller(this);
     320    CheckComRCReturnRC(autoCaller.rc());
    321321
    322322    /* no need to lock, this is const */
     
    331331        return E_POINTER;
    332332
    333     AutoCaller autoCaller (this);
    334     CheckComRCReturnRC (autoCaller.rc());
     333    AutoCaller autoCaller(this);
     334    CheckComRCReturnRC(autoCaller.rc());
    335335
    336336    /* no need to lock, this is const */
     
    344344    CheckComArgOutPointerValid(aMaxBootPosition);
    345345
    346     AutoCaller autoCaller (this);
    347     CheckComRCReturnRC (autoCaller.rc());
     346    AutoCaller autoCaller(this);
     347    CheckComRCReturnRC(autoCaller.rc());
    348348
    349349    /* no need to lock, this is const */
     
    357357    CheckComArgOutPointerValid(aDefaultMachineFolder);
    358358
    359     AutoCaller autoCaller (this);
    360     CheckComRCReturnRC (autoCaller.rc());
    361 
    362     AutoReadLock alock (this);
    363 
    364     mDefaultMachineFolderFull.cloneTo (aDefaultMachineFolder);
     359    AutoCaller autoCaller(this);
     360    CheckComRCReturnRC(autoCaller.rc());
     361
     362    AutoReadLock alock(this);
     363
     364    mDefaultMachineFolderFull.cloneTo(aDefaultMachineFolder);
    365365
    366366    return S_OK;
     
    369369STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder) (IN_BSTR aDefaultMachineFolder)
    370370{
    371     AutoCaller autoCaller (this);
    372     CheckComRCReturnRC (autoCaller.rc());
     371    AutoCaller autoCaller(this);
     372    CheckComRCReturnRC(autoCaller.rc());
    373373
    374374    /* VirtualBox::saveSettings() needs a write lock */
     
    376376
    377377    HRESULT rc = setDefaultMachineFolder (aDefaultMachineFolder);
    378     if (SUCCEEDED (rc))
     378    if (SUCCEEDED(rc))
    379379        rc = mParent->saveSettings();
    380380
     
    386386    CheckComArgOutPointerValid(aDefaultHardDiskFolder);
    387387
    388     AutoCaller autoCaller (this);
    389     CheckComRCReturnRC (autoCaller.rc());
    390 
    391     AutoReadLock alock (this);
    392 
    393     mDefaultHardDiskFolderFull.cloneTo (aDefaultHardDiskFolder);
     388    AutoCaller autoCaller(this);
     389    CheckComRCReturnRC(autoCaller.rc());
     390
     391    AutoReadLock alock(this);
     392
     393    mDefaultHardDiskFolderFull.cloneTo(aDefaultHardDiskFolder);
    394394
    395395    return S_OK;
     
    398398STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFolder) (IN_BSTR aDefaultHardDiskFolder)
    399399{
    400     AutoCaller autoCaller (this);
    401     CheckComRCReturnRC (autoCaller.rc());
     400    AutoCaller autoCaller(this);
     401    CheckComRCReturnRC(autoCaller.rc());
    402402
    403403    /* VirtualBox::saveSettings() needs a write lock */
     
    405405
    406406    HRESULT rc = setDefaultHardDiskFolder (aDefaultHardDiskFolder);
    407     if (SUCCEEDED (rc))
     407    if (SUCCEEDED(rc))
    408408        rc = mParent->saveSettings();
    409409
     
    412412
    413413STDMETHODIMP SystemProperties::
    414 COMGETTER(HardDiskFormats) (ComSafeArrayOut (IHardDiskFormat *, aHardDiskFormats))
    415 {
    416     if (ComSafeArrayOutIsNull (aHardDiskFormats))
    417         return E_POINTER;
    418 
    419     AutoCaller autoCaller (this);
    420     CheckComRCReturnRC (autoCaller.rc());
    421 
    422     AutoReadLock alock (this);
    423 
    424     SafeIfaceArray <IHardDiskFormat> hardDiskFormats (mHardDiskFormats);
    425     hardDiskFormats.detachTo (ComSafeArrayOutArg (aHardDiskFormats));
     414COMGETTER(HardDiskFormats) (ComSafeArrayOut(IHardDiskFormat *, aHardDiskFormats))
     415{
     416    if (ComSafeArrayOutIsNull(aHardDiskFormats))
     417        return E_POINTER;
     418
     419    AutoCaller autoCaller(this);
     420    CheckComRCReturnRC(autoCaller.rc());
     421
     422    AutoReadLock alock(this);
     423
     424    SafeIfaceArray<IHardDiskFormat> hardDiskFormats (mHardDiskFormats);
     425    hardDiskFormats.detachTo(ComSafeArrayOutArg(aHardDiskFormats));
    426426
    427427    return S_OK;
     
    432432    CheckComArgOutPointerValid(aDefaultHardDiskFormat);
    433433
    434     AutoCaller autoCaller (this);
    435     CheckComRCReturnRC (autoCaller.rc());
    436 
    437     AutoReadLock alock (this);
    438 
    439     mDefaultHardDiskFormat.cloneTo (aDefaultHardDiskFormat);
     434    AutoCaller autoCaller(this);
     435    CheckComRCReturnRC(autoCaller.rc());
     436
     437    AutoReadLock alock(this);
     438
     439    mDefaultHardDiskFormat.cloneTo(aDefaultHardDiskFormat);
    440440
    441441    return S_OK;
     
    444444STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat) (IN_BSTR aDefaultHardDiskFormat)
    445445{
    446     AutoCaller autoCaller (this);
    447     CheckComRCReturnRC (autoCaller.rc());
     446    AutoCaller autoCaller(this);
     447    CheckComRCReturnRC(autoCaller.rc());
    448448
    449449    /* VirtualBox::saveSettings() needs a write lock */
     
    451451
    452452    HRESULT rc = setDefaultHardDiskFormat (aDefaultHardDiskFormat);
    453     if (SUCCEEDED (rc))
     453    if (SUCCEEDED(rc))
    454454        rc = mParent->saveSettings();
    455455
     
    461461    CheckComArgOutPointerValid(aRemoteDisplayAuthLibrary);
    462462
    463     AutoCaller autoCaller (this);
    464     CheckComRCReturnRC (autoCaller.rc());
    465 
    466     AutoReadLock alock (this);
    467 
    468     mRemoteDisplayAuthLibrary.cloneTo (aRemoteDisplayAuthLibrary);
     463    AutoCaller autoCaller(this);
     464    CheckComRCReturnRC(autoCaller.rc());
     465
     466    AutoReadLock alock(this);
     467
     468    mRemoteDisplayAuthLibrary.cloneTo(aRemoteDisplayAuthLibrary);
    469469
    470470    return S_OK;
     
    473473STDMETHODIMP SystemProperties::COMSETTER(RemoteDisplayAuthLibrary) (IN_BSTR aRemoteDisplayAuthLibrary)
    474474{
    475     AutoCaller autoCaller (this);
    476     CheckComRCReturnRC (autoCaller.rc());
     475    AutoCaller autoCaller(this);
     476    CheckComRCReturnRC(autoCaller.rc());
    477477
    478478    /* VirtualBox::saveSettings() needs a write lock */
     
    480480
    481481    HRESULT rc = setRemoteDisplayAuthLibrary (aRemoteDisplayAuthLibrary);
    482     if (SUCCEEDED (rc))
     482    if (SUCCEEDED(rc))
    483483        rc = mParent->saveSettings();
    484484
     
    490490    CheckComArgOutPointerValid(aWebServiceAuthLibrary);
    491491
    492     AutoCaller autoCaller (this);
    493     CheckComRCReturnRC (autoCaller.rc());
    494 
    495     AutoReadLock alock (this);
    496 
    497     mWebServiceAuthLibrary.cloneTo (aWebServiceAuthLibrary);
     492    AutoCaller autoCaller(this);
     493    CheckComRCReturnRC(autoCaller.rc());
     494
     495    AutoReadLock alock(this);
     496
     497    mWebServiceAuthLibrary.cloneTo(aWebServiceAuthLibrary);
    498498
    499499    return S_OK;
     
    502502STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary) (IN_BSTR aWebServiceAuthLibrary)
    503503{
    504     AutoCaller autoCaller (this);
    505     CheckComRCReturnRC (autoCaller.rc());
     504    AutoCaller autoCaller(this);
     505    CheckComRCReturnRC(autoCaller.rc());
    506506
    507507    /* VirtualBox::saveSettings() needs a write lock */
     
    509509
    510510    HRESULT rc = setWebServiceAuthLibrary (aWebServiceAuthLibrary);
    511     if (SUCCEEDED (rc))
     511    if (SUCCEEDED(rc))
    512512        rc = mParent->saveSettings();
    513513
     
    520520        return E_POINTER;
    521521
    522     AutoCaller autoCaller (this);
    523     CheckComRCReturnRC (autoCaller.rc());
    524 
    525     AutoReadLock alock (this);
     522    AutoCaller autoCaller(this);
     523    CheckComRCReturnRC(autoCaller.rc());
     524
     525    AutoReadLock alock(this);
    526526
    527527    *count = mLogHistoryCount;
     
    532532STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount) (ULONG count)
    533533{
    534     AutoCaller autoCaller (this);
    535     CheckComRCReturnRC (autoCaller.rc());
     534    AutoCaller autoCaller(this);
     535    CheckComRCReturnRC(autoCaller.rc());
    536536
    537537    /* VirtualBox::saveSettings() needs a write lock */
     
    550550        return E_POINTER;
    551551
    552     AutoCaller autoCaller (this);
    553     CheckComRCReturnRC (autoCaller.rc());
    554 
    555     AutoReadLock alock (this);
     552    AutoCaller autoCaller(this);
     553    CheckComRCReturnRC(autoCaller.rc());
     554
     555    AutoReadLock alock(this);
    556556
    557557    *aAudioDriver = mDefaultAudioDriver;
     
    567567    using namespace settings;
    568568
    569     AutoCaller autoCaller (this);
    570     CheckComRCReturnRC (autoCaller.rc());
    571 
    572     AutoWriteLock alock (this);
    573 
    574     AssertReturn (!aGlobal.isNull(), E_FAIL);
     569    AutoCaller autoCaller(this);
     570    CheckComRCReturnRC(autoCaller.rc());
     571
     572    AutoWriteLock alock(this);
     573
     574    AssertReturn(!aGlobal.isNull(), E_FAIL);
    575575
    576576    HRESULT rc = S_OK;
     
    582582    bstr = properties.stringValue ("defaultMachineFolder");
    583583    rc = setDefaultMachineFolder (bstr);
    584     CheckComRCReturnRC (rc);
     584    CheckComRCReturnRC(rc);
    585585
    586586    bstr = properties.stringValue ("defaultHardDiskFolder");
    587587    rc = setDefaultHardDiskFolder (bstr);
    588     CheckComRCReturnRC (rc);
     588    CheckComRCReturnRC(rc);
    589589
    590590    bstr = properties.stringValue ("defaultHardDiskFormat");
    591591    rc = setDefaultHardDiskFormat (bstr);
    592     CheckComRCReturnRC (rc);
     592    CheckComRCReturnRC(rc);
    593593
    594594    bstr = properties.stringValue ("remoteDisplayAuthLibrary");
    595595    rc = setRemoteDisplayAuthLibrary (bstr);
    596     CheckComRCReturnRC (rc);
     596    CheckComRCReturnRC(rc);
    597597
    598598    bstr = properties.stringValue ("webServiceAuthLibrary");
    599599    rc = setWebServiceAuthLibrary (bstr);
    600     CheckComRCReturnRC (rc);
     600    CheckComRCReturnRC(rc);
    601601
    602602    mLogHistoryCount = properties.valueOr <ULONG> ("LogHistoryCount", 3);
     
    609609    using namespace settings;
    610610
    611     AutoCaller autoCaller (this);
    612     CheckComRCReturnRC (autoCaller.rc());
    613 
    614     AutoReadLock alock (this);
     611    AutoCaller autoCaller(this);
     612    CheckComRCReturnRC(autoCaller.rc());
     613
     614    AutoReadLock alock(this);
    615615
    616616    ComAssertRet (!aGlobal.isNull(), E_FAIL);
     
    651651 * @return ComObjPtr<HardDiskFormat>
    652652 */
    653 ComObjPtr <HardDiskFormat> SystemProperties::hardDiskFormat (CBSTR aFormat)
    654 {
    655     ComObjPtr <HardDiskFormat> format;
    656 
    657     AutoCaller autoCaller (this);
     653ComObjPtr<HardDiskFormat> SystemProperties::hardDiskFormat (CBSTR aFormat)
     654{
     655    ComObjPtr<HardDiskFormat> format;
     656
     657    AutoCaller autoCaller(this);
    658658    AssertComRCReturn (autoCaller.rc(), format);
    659659
    660     AutoReadLock alock (this);
     660    AutoReadLock alock(this);
    661661
    662662    for (HardDiskFormatList::const_iterator it = mHardDiskFormats.begin();
     
    689689    Utf8Str folder;
    690690    int vrc = mParent->calculateFullPath (path, folder);
    691     if (RT_FAILURE (vrc))
     691    if (RT_FAILURE(vrc))
    692692        return setError (E_FAIL,
    693693            tr ("Invalid default machine folder '%ls' (%Rrc)"),
     
    711711    Utf8Str folder;
    712712    int vrc = mParent->calculateFullPath (path, folder);
    713     if (RT_FAILURE (vrc))
     713    if (RT_FAILURE(vrc))
    714714        return setError (E_FAIL,
    715715            tr ("Invalid default hard disk folder '%ls' (%Rrc)"),
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r21823 r21878  
    7070HRESULT USBController::init (Machine *aParent)
    7171{
    72     LogFlowThisFunc (("aParent=%p\n", aParent));
     72    LogFlowThisFunc(("aParent=%p\n", aParent));
    7373
    7474    ComAssertRet (aParent, E_INVALIDARG);
    7575
    7676    /* Enclose the state transition NotReady->InInit->Ready */
    77     AutoInitSpan autoInitSpan (this);
    78     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    79 
    80     unconst (mParent) = aParent;
     77    AutoInitSpan autoInitSpan(this);
     78    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     79
     80    unconst(mParent) = aParent;
    8181    /* mPeer is left null */
    8282
     
    106106HRESULT USBController::init (Machine *aParent, USBController *aPeer)
    107107{
    108     LogFlowThisFunc (("aParent=%p, aPeer=%p\n", aParent, aPeer));
     108    LogFlowThisFunc(("aParent=%p, aPeer=%p\n", aParent, aPeer));
    109109
    110110    ComAssertRet (aParent && aPeer, E_INVALIDARG);
    111111
    112112    /* Enclose the state transition NotReady->InInit->Ready */
    113     AutoInitSpan autoInitSpan (this);
    114     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    115 
    116     unconst (mParent) = aParent;
    117     unconst (mPeer) = aPeer;
     113    AutoInitSpan autoInitSpan(this);
     114    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     115
     116    unconst(mParent) = aParent;
     117    unconst(mPeer) = aPeer;
    118118
    119119    AutoWriteLock thatlock (aPeer);
     
    126126    while (it != aPeer->mDeviceFilters->end())
    127127    {
    128         ComObjPtr <USBDeviceFilter> filter;
     128        ComObjPtr<USBDeviceFilter> filter;
    129129        filter.createObject();
    130130        filter->init (this, *it);
     
    148148HRESULT USBController::initCopy (Machine *aParent, USBController *aPeer)
    149149{
    150     LogFlowThisFunc (("aParent=%p, aPeer=%p\n", aParent, aPeer));
     150    LogFlowThisFunc(("aParent=%p, aPeer=%p\n", aParent, aPeer));
    151151
    152152    ComAssertRet (aParent && aPeer, E_INVALIDARG);
    153153
    154154    /* Enclose the state transition NotReady->InInit->Ready */
    155     AutoInitSpan autoInitSpan (this);
    156     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    157 
    158     unconst (mParent) = aParent;
     155    AutoInitSpan autoInitSpan(this);
     156    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     157
     158    unconst(mParent) = aParent;
    159159    /* mPeer is left null */
    160160
     
    168168    while (it != aPeer->mDeviceFilters->end())
    169169    {
    170         ComObjPtr <USBDeviceFilter> filter;
     170        ComObjPtr<USBDeviceFilter> filter;
    171171        filter.createObject();
    172172        filter->initCopy (this, *it);
     
    189189void USBController::uninit()
    190190{
    191     LogFlowThisFunc (("\n"));
     191    LogFlowThisFunc(("\n"));
    192192
    193193    /* Enclose the state transition Ready->InUninit->NotReady */
    194     AutoUninitSpan autoUninitSpan (this);
     194    AutoUninitSpan autoUninitSpan(this);
    195195    if (autoUninitSpan.uninitDone())
    196196        return;
     
    204204    mData.free();
    205205
    206     unconst (mPeer).setNull();
    207     unconst (mParent).setNull();
     206    unconst(mPeer).setNull();
     207    unconst(mParent).setNull();
    208208}
    209209
     
    216216    CheckComArgOutPointerValid(aEnabled);
    217217
    218     AutoCaller autoCaller (this);
    219     CheckComRCReturnRC (autoCaller.rc());
    220 
    221     AutoReadLock alock (this);
     218    AutoCaller autoCaller(this);
     219    CheckComRCReturnRC(autoCaller.rc());
     220
     221    AutoReadLock alock(this);
    222222
    223223    *aEnabled = mData->mEnabled;
     
    229229STDMETHODIMP USBController::COMSETTER(Enabled) (BOOL aEnabled)
    230230{
    231     LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
    232 
    233     AutoCaller autoCaller (this);
    234     CheckComRCReturnRC (autoCaller.rc());
     231    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     232
     233    AutoCaller autoCaller(this);
     234    CheckComRCReturnRC(autoCaller.rc());
    235235
    236236    /* the machine needs to be mutable */
    237237    Machine::AutoMutableStateDependency adep (mParent);
    238     CheckComRCReturnRC (adep.rc());
    239 
    240     AutoWriteLock alock (this);
     238    CheckComRCReturnRC(adep.rc());
     239
     240    AutoWriteLock alock(this);
    241241
    242242    if (mData->mEnabled != aEnabled)
     
    258258    CheckComArgOutPointerValid(aEnabled);
    259259
    260     AutoCaller autoCaller (this);
    261     CheckComRCReturnRC (autoCaller.rc());
    262 
    263     AutoReadLock alock (this);
     260    AutoCaller autoCaller(this);
     261    CheckComRCReturnRC(autoCaller.rc());
     262
     263    AutoReadLock alock(this);
    264264
    265265    *aEnabled = mData->mEnabledEhci;
     
    270270STDMETHODIMP USBController::COMSETTER(EnabledEhci) (BOOL aEnabled)
    271271{
    272     LogFlowThisFunc (("aEnabled=%RTbool\n", aEnabled));
    273 
    274     AutoCaller autoCaller (this);
    275     CheckComRCReturnRC (autoCaller.rc());
     272    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
     273
     274    AutoCaller autoCaller(this);
     275    CheckComRCReturnRC(autoCaller.rc());
    276276
    277277    /* the machine needs to be mutable */
    278278    Machine::AutoMutableStateDependency adep (mParent);
    279     CheckComRCReturnRC (adep.rc());
    280 
    281     AutoWriteLock alock (this);
     279    CheckComRCReturnRC(adep.rc());
     280
     281    AutoWriteLock alock(this);
    282282
    283283    if (mData->mEnabledEhci != aEnabled)
     
    299299    CheckComArgOutPointerValid(aUSBStandard);
    300300
    301     AutoCaller autoCaller (this);
    302     CheckComRCReturnRC (autoCaller.rc());
     301    AutoCaller autoCaller(this);
     302    CheckComRCReturnRC(autoCaller.rc());
    303303
    304304    /* not accessing data -- no need to lock */
     
    365365    CheckComArgOutSafeArrayPointerValid(aDevicesFilters);
    366366
    367     AutoCaller autoCaller (this);
    368     CheckComRCReturnRC (autoCaller.rc());
    369 
    370     AutoReadLock alock (this);
    371 
    372     SafeIfaceArray <IUSBDeviceFilter> collection (*mDeviceFilters.data());
    373     collection.detachTo (ComSafeArrayOutArg (aDevicesFilters));
     367    AutoCaller autoCaller(this);
     368    CheckComRCReturnRC(autoCaller.rc());
     369
     370    AutoReadLock alock(this);
     371
     372    SafeIfaceArray<IUSBDeviceFilter> collection (*mDeviceFilters.data());
     373    collection.detachTo(ComSafeArrayOutArg(aDevicesFilters));
    374374
    375375    return S_OK;
     
    394394    CheckComArgStrNotEmptyOrNull(aName);
    395395
    396     AutoCaller autoCaller (this);
    397     CheckComRCReturnRC (autoCaller.rc());
     396    AutoCaller autoCaller(this);
     397    CheckComRCReturnRC(autoCaller.rc());
    398398
    399399    /* the machine needs to be mutable */
    400400    Machine::AutoMutableStateDependency adep (mParent);
    401     CheckComRCReturnRC (adep.rc());
    402 
    403     AutoWriteLock alock (this);
    404 
    405     ComObjPtr <USBDeviceFilter> filter;
     401    CheckComRCReturnRC(adep.rc());
     402
     403    AutoWriteLock alock(this);
     404
     405    ComObjPtr<USBDeviceFilter> filter;
    406406    filter.createObject();
    407407    HRESULT rc = filter->init (this, aName);
    408408    ComAssertComRCRetRC (rc);
    409     rc = filter.queryInterfaceTo (aFilter);
    410     AssertComRCReturnRC (rc);
     409    rc = filter.queryInterfaceTo(aFilter);
     410    AssertComRCReturnRC(rc);
    411411
    412412    return S_OK;
     
    425425    CheckComArgNotNull(aFilter);
    426426
    427     AutoCaller autoCaller (this);
    428     CheckComRCReturnRC (autoCaller.rc());
     427    AutoCaller autoCaller(this);
     428    CheckComRCReturnRC(autoCaller.rc());
    429429
    430430    /* the machine needs to be mutable */
    431431    Machine::AutoMutableStateDependency adep (mParent);
    432     CheckComRCReturnRC (adep.rc());
    433 
    434     AutoWriteLock alock (this);
    435 
    436     ComObjPtr <USBDeviceFilter> filter = getDependentChild (aFilter);
     432    CheckComRCReturnRC(adep.rc());
     433
     434    AutoWriteLock alock(this);
     435
     436    ComObjPtr<USBDeviceFilter> filter = getDependentChild (aFilter);
    437437    if (!filter)
    438438        return setError (E_INVALIDARG,
     
    488488    CheckComArgOutPointerValid(aFilter);
    489489
    490     AutoCaller autoCaller (this);
    491     CheckComRCReturnRC (autoCaller.rc());
     490    AutoCaller autoCaller(this);
     491    CheckComRCReturnRC(autoCaller.rc());
    492492
    493493    /* the machine needs to be mutable */
    494494    Machine::AutoMutableStateDependency adep (mParent);
    495     CheckComRCReturnRC (adep.rc());
    496 
    497     AutoWriteLock alock (this);
     495    CheckComRCReturnRC(adep.rc());
     496
     497    AutoWriteLock alock(this);
    498498
    499499    if (!mDeviceFilters->size())
     
    509509    mDeviceFilters.backup();
    510510
    511     ComObjPtr <USBDeviceFilter> filter;
     511    ComObjPtr<USBDeviceFilter> filter;
    512512    {
    513513        /* iterate to the position... */
     
    524524    filter->unshare();
    525525
    526     filter.queryInterfaceTo (aFilter);
     526    filter.queryInterfaceTo(aFilter);
    527527
    528528    /* notify the proxy (only when it makes sense) */
     
    563563    using namespace settings;
    564564
    565     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    566 
    567     AutoCaller autoCaller (this);
    568     AssertComRCReturnRC (autoCaller.rc());
    569 
    570     AutoWriteLock alock (this);
     565    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     566
     567    AutoCaller autoCaller(this);
     568    AssertComRCReturnRC(autoCaller.rc());
     569
     570    AutoWriteLock alock(this);
    571571
    572572    /* Note: we assume that the default values for attributes of optional
     
    612612        ULONG maskedIfs = (*it).value <ULONG> ("maskedInterfaces");
    613613
    614         ComObjPtr <USBDeviceFilter> filterObj;
     614        ComObjPtr<USBDeviceFilter> filterObj;
    615615        filterObj.createObject();
    616616        rc = filterObj->init (this,
     
    619619                              port, remote, maskedIfs);
    620620        /* error info is set by init() when appropriate */
    621         CheckComRCReturnRC (rc);
     621        CheckComRCReturnRC(rc);
    622622
    623623        mDeviceFilters->push_back (filterObj);
     
    640640    using namespace settings;
    641641
    642     AssertReturn (!aMachineNode.isNull(), E_FAIL);
    643 
    644     AutoCaller autoCaller (this);
    645     CheckComRCReturnRC (autoCaller.rc());
    646 
    647     AutoReadLock alock (this);
     642    AssertReturn(!aMachineNode.isNull(), E_FAIL);
     643
     644    AutoCaller autoCaller(this);
     645    CheckComRCReturnRC(autoCaller.rc());
     646
     647    AutoReadLock alock(this);
    648648
    649649    /* first, delete the entry */
     
    724724bool USBController::isModified()
    725725{
    726     AutoCaller autoCaller (this);
     726    AutoCaller autoCaller(this);
    727727    AssertComRCReturn (autoCaller.rc(), false);
    728728
    729     AutoReadLock alock (this);
     729    AutoReadLock alock(this);
    730730
    731731    if (mData.isBackedUp()
     
    754754bool USBController::isReallyModified()
    755755{
    756     AutoCaller autoCaller (this);
     756    AutoCaller autoCaller(this);
    757757    AssertComRCReturn (autoCaller.rc(), false);
    758758
    759     AutoReadLock alock (this);
     759    AutoReadLock alock(this);
    760760
    761761    if (mData.hasActualChanges())
     
    819819bool USBController::rollback()
    820820{
    821     AutoCaller autoCaller (this);
     821    AutoCaller autoCaller(this);
    822822    AssertComRCReturn (autoCaller.rc(), false);
    823823
     
    826826    AssertComRCReturn (adep.rc(), false);
    827827
    828     AutoWriteLock alock (this);
     828    AutoWriteLock alock(this);
    829829
    830830    bool dataChanged = false;
     
    922922{
    923923    /* sanity */
    924     AutoCaller autoCaller (this);
     924    AutoCaller autoCaller(this);
    925925    AssertComRCReturnVoid (autoCaller.rc());
    926926
     
    965965
    966966                /* look if this filter has a peer filter */
    967                 ComObjPtr <USBDeviceFilter> peer = (*it)->peer();
     967                ComObjPtr<USBDeviceFilter> peer = (*it)->peer();
    968968                if (!peer)
    969969                {
     
    10301030
    10311031    /* sanity */
    1032     AutoCaller autoCaller (this);
     1032    AutoCaller autoCaller(this);
    10331033    AssertComRCReturnVoid (autoCaller.rc());
    10341034
     
    10621062        ++ it)
    10631063    {
    1064         ComObjPtr <USBDeviceFilter> filter;
     1064        ComObjPtr<USBDeviceFilter> filter;
    10651065        filter.createObject();
    10661066        filter->initCopy (this, *it);
     
    10811081                                             BOOL aActiveChanged /* = FALSE */)
    10821082{
    1083     AutoCaller autoCaller (this);
    1084     AssertComRCReturnRC (autoCaller.rc());
     1083    AutoCaller autoCaller(this);
     1084    AssertComRCReturnRC(autoCaller.rc());
    10851085
    10861086    /* we need the machine state */
    10871087    Machine::AutoAnyStateDependency adep (mParent);
    1088     AssertComRCReturnRC (adep.rc());
     1088    AssertComRCReturnRC(adep.rc());
    10891089
    10901090    /* nothing to do if the machine isn't running */
     
    11371137 *  @note Locks this object for reading.
    11381138 */
    1139 bool USBController::hasMatchingFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
    1140 {
    1141     AutoCaller autoCaller (this);
     1139bool USBController::hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
     1140{
     1141    AutoCaller autoCaller(this);
    11421142    AssertComRCReturn (autoCaller.rc(), false);
    11431143
    1144     AutoReadLock alock (this);
     1144    AutoReadLock alock(this);
    11451145
    11461146    /* Disabled USB controllers cannot actually work with USB devices */
     
    11801180    LogFlowThisFuncEnter();
    11811181
    1182     AutoCaller autoCaller (this);
     1182    AutoCaller autoCaller(this);
    11831183    AssertComRCReturn (autoCaller.rc(), false);
    11841184
    1185     AutoReadLock alock (this);
     1185    AutoReadLock alock(this);
    11861186
    11871187    /* Disabled USB controllers cannot actually work with USB devices */
     
    12651265    }
    12661266
    1267     LogFlowThisFunc (("returns: %d\n", match));
     1267    LogFlowThisFunc(("returns: %d\n", match));
    12681268    LogFlowThisFuncLeave();
    12691269
     
    12811281HRESULT USBController::notifyProxy (bool aInsertFilters)
    12821282{
    1283     LogFlowThisFunc (("aInsertFilters=%RTbool\n", aInsertFilters));
    1284 
    1285     AutoCaller autoCaller (this);
     1283    LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters));
     1284
     1285    AutoCaller autoCaller(this);
    12861286    AssertComRCReturn (autoCaller.rc(), false);
    12871287
    1288     AutoReadLock alock (this);
     1288    AutoReadLock alock(this);
    12891289
    12901290    USBProxyService *service = mParent->virtualBox()->host()->usbProxyService();
    1291     AssertReturn (service, E_FAIL);
     1291    AssertReturn(service, E_FAIL);
    12921292
    12931293    DeviceFilterList::const_iterator it = mDeviceFilters->begin();
     
    13011301            if (aInsertFilters)
    13021302            {
    1303                 AssertReturn (flt->id() == NULL, E_FAIL);
     1303                AssertReturn(flt->id() == NULL, E_FAIL);
    13041304                flt->id() = service->insertFilter (&flt->data().mUSBFilter);
    13051305            }
  • trunk/src/VBox/Main/USBDeviceImpl.cpp

    r20976 r21878  
    5151HRESULT OUSBDevice::init(IUSBDevice *aUSBDevice)
    5252{
    53     LogFlowThisFunc (("aUSBDevice=%p\n", aUSBDevice));
     53    LogFlowThisFunc(("aUSBDevice=%p\n", aUSBDevice));
    5454
    5555    ComAssertRet (aUSBDevice, E_INVALIDARG);
    5656
    5757    /* Enclose the state transition NotReady->InInit->Ready */
    58     AutoInitSpan autoInitSpan (this);
    59     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    60 
    61     HRESULT hrc = aUSBDevice->COMGETTER(VendorId)(&unconst (mData.vendorId));
     58    AutoInitSpan autoInitSpan(this);
     59    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     60
     61    HRESULT hrc = aUSBDevice->COMGETTER(VendorId)(&unconst(mData.vendorId));
    6262    ComAssertComRCRet (hrc, hrc);
    6363    ComAssertRet (mData.vendorId, E_INVALIDARG);
    6464
    65     hrc = aUSBDevice->COMGETTER(ProductId)(&unconst (mData.productId));
    66     ComAssertComRCRet (hrc, hrc);
    67 
    68     hrc = aUSBDevice->COMGETTER(Revision)(&unconst (mData.revision));
    69     ComAssertComRCRet (hrc, hrc);
    70 
    71     hrc = aUSBDevice->COMGETTER(Manufacturer)(unconst (mData.manufacturer).asOutParam());
    72     ComAssertComRCRet (hrc, hrc);
    73 
    74     hrc = aUSBDevice->COMGETTER(Product)(unconst (mData.product).asOutParam());
    75     ComAssertComRCRet (hrc, hrc);
    76 
    77     hrc = aUSBDevice->COMGETTER(SerialNumber)(unconst (mData.serialNumber).asOutParam());
    78     ComAssertComRCRet (hrc, hrc);
    79 
    80     hrc = aUSBDevice->COMGETTER(Address)(unconst (mData.address).asOutParam());
    81     ComAssertComRCRet (hrc, hrc);
    82 
    83     hrc = aUSBDevice->COMGETTER(Port)(&unconst (mData.port));
    84     ComAssertComRCRet (hrc, hrc);
    85 
    86     hrc = aUSBDevice->COMGETTER(Port)(&unconst (mData.version));
    87     ComAssertComRCRet (hrc, hrc);
    88 
    89     hrc = aUSBDevice->COMGETTER(Port)(&unconst (mData.portVersion));
    90     ComAssertComRCRet (hrc, hrc);
    91 
    92     hrc = aUSBDevice->COMGETTER(Remote)(&unconst (mData.remote));
     65    hrc = aUSBDevice->COMGETTER(ProductId)(&unconst(mData.productId));
     66    ComAssertComRCRet (hrc, hrc);
     67
     68    hrc = aUSBDevice->COMGETTER(Revision)(&unconst(mData.revision));
     69    ComAssertComRCRet (hrc, hrc);
     70
     71    hrc = aUSBDevice->COMGETTER(Manufacturer)(unconst(mData.manufacturer).asOutParam());
     72    ComAssertComRCRet (hrc, hrc);
     73
     74    hrc = aUSBDevice->COMGETTER(Product)(unconst(mData.product).asOutParam());
     75    ComAssertComRCRet (hrc, hrc);
     76
     77    hrc = aUSBDevice->COMGETTER(SerialNumber)(unconst(mData.serialNumber).asOutParam());
     78    ComAssertComRCRet (hrc, hrc);
     79
     80    hrc = aUSBDevice->COMGETTER(Address)(unconst(mData.address).asOutParam());
     81    ComAssertComRCRet (hrc, hrc);
     82
     83    hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.port));
     84    ComAssertComRCRet (hrc, hrc);
     85
     86    hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.version));
     87    ComAssertComRCRet (hrc, hrc);
     88
     89    hrc = aUSBDevice->COMGETTER(Port)(&unconst(mData.portVersion));
     90    ComAssertComRCRet (hrc, hrc);
     91
     92    hrc = aUSBDevice->COMGETTER(Remote)(&unconst(mData.remote));
    9393    ComAssertComRCRet (hrc, hrc);
    9494
     
    110110void OUSBDevice::uninit()
    111111{
    112     LogFlowThisFunc (("\n"));
     112    LogFlowThisFunc(("\n"));
    113113
    114114    /* Enclose the state transition Ready->InUninit->NotReady */
    115     AutoUninitSpan autoUninitSpan (this);
     115    AutoUninitSpan autoUninitSpan(this);
    116116    if (autoUninitSpan.uninitDone())
    117117        return;
    118118
    119     unconst (mData.id).clear();
    120 
    121     unconst (mData.vendorId) = 0;
    122     unconst (mData.productId) = 0;
    123     unconst (mData.revision) = 0;
    124 
    125     unconst (mData.manufacturer).setNull();
    126     unconst (mData.product).setNull();
    127     unconst (mData.serialNumber).setNull();
    128 
    129     unconst (mData.address).setNull();
    130 
    131     unconst (mData.port) = 0;
    132     unconst (mData.version) = 1;
    133     unconst (mData.portVersion) = 1;
    134 
    135     unconst (mData.remote) = FALSE;
     119    unconst(mData.id).clear();
     120
     121    unconst(mData.vendorId) = 0;
     122    unconst(mData.productId) = 0;
     123    unconst(mData.revision) = 0;
     124
     125    unconst(mData.manufacturer).setNull();
     126    unconst(mData.product).setNull();
     127    unconst(mData.serialNumber).setNull();
     128
     129    unconst(mData.address).setNull();
     130
     131    unconst(mData.port) = 0;
     132    unconst(mData.version) = 1;
     133    unconst(mData.portVersion) = 1;
     134
     135    unconst(mData.remote) = FALSE;
    136136}
    137137
     
    149149    CheckComArgOutPointerValid(aId);
    150150
    151     AutoCaller autoCaller (this);
    152     CheckComRCReturnRC (autoCaller.rc());
    153 
    154     /* this is const, no need to lock */
    155     Guid(mData.id).toString().cloneTo (aId);
     151    AutoCaller autoCaller(this);
     152    CheckComRCReturnRC(autoCaller.rc());
     153
     154    /* this is const, no need to lock */
     155    Guid(mData.id).toString().cloneTo(aId);
    156156
    157157    return S_OK;
     
    169169    CheckComArgOutPointerValid(aVendorId);
    170170
    171     AutoCaller autoCaller (this);
    172     CheckComRCReturnRC (autoCaller.rc());
     171    AutoCaller autoCaller(this);
     172    CheckComRCReturnRC(autoCaller.rc());
    173173
    174174    /* this is const, no need to lock */
     
    189189    CheckComArgOutPointerValid(aProductId);
    190190
    191     AutoCaller autoCaller (this);
    192     CheckComRCReturnRC (autoCaller.rc());
     191    AutoCaller autoCaller(this);
     192    CheckComRCReturnRC(autoCaller.rc());
    193193
    194194    /* this is const, no need to lock */
     
    209209    CheckComArgOutPointerValid(aRevision);
    210210
    211     AutoCaller autoCaller (this);
    212     CheckComRCReturnRC (autoCaller.rc());
     211    AutoCaller autoCaller(this);
     212    CheckComRCReturnRC(autoCaller.rc());
    213213
    214214    /* this is const, no need to lock */
     
    228228    CheckComArgOutPointerValid(aManufacturer);
    229229
    230     AutoCaller autoCaller (this);
    231     CheckComRCReturnRC (autoCaller.rc());
    232 
    233     /* this is const, no need to lock */
    234     mData.manufacturer.cloneTo (aManufacturer);
     230    AutoCaller autoCaller(this);
     231    CheckComRCReturnRC(autoCaller.rc());
     232
     233    /* this is const, no need to lock */
     234    mData.manufacturer.cloneTo(aManufacturer);
    235235
    236236    return S_OK;
     
    248248    CheckComArgOutPointerValid(aProduct);
    249249
    250     AutoCaller autoCaller (this);
    251     CheckComRCReturnRC (autoCaller.rc());
    252 
    253     /* this is const, no need to lock */
    254     mData.product.cloneTo (aProduct);
     250    AutoCaller autoCaller(this);
     251    CheckComRCReturnRC(autoCaller.rc());
     252
     253    /* this is const, no need to lock */
     254    mData.product.cloneTo(aProduct);
    255255
    256256    return S_OK;
     
    268268    CheckComArgOutPointerValid(aSerialNumber);
    269269
    270     AutoCaller autoCaller (this);
    271     CheckComRCReturnRC (autoCaller.rc());
    272 
    273     /* this is const, no need to lock */
    274     mData.serialNumber.cloneTo (aSerialNumber);
     270    AutoCaller autoCaller(this);
     271    CheckComRCReturnRC(autoCaller.rc());
     272
     273    /* this is const, no need to lock */
     274    mData.serialNumber.cloneTo(aSerialNumber);
    275275
    276276    return S_OK;
     
    288288    CheckComArgOutPointerValid(aAddress);
    289289
    290     AutoCaller autoCaller (this);
    291     CheckComRCReturnRC (autoCaller.rc());
    292 
    293     /* this is const, no need to lock */
    294     mData.address.cloneTo (aAddress);
     290    AutoCaller autoCaller(this);
     291    CheckComRCReturnRC(autoCaller.rc());
     292
     293    /* this is const, no need to lock */
     294    mData.address.cloneTo(aAddress);
    295295
    296296    return S_OK;
     
    301301    CheckComArgOutPointerValid(aPort);
    302302
    303     AutoCaller autoCaller (this);
    304     CheckComRCReturnRC (autoCaller.rc());
     303    AutoCaller autoCaller(this);
     304    CheckComRCReturnRC(autoCaller.rc());
    305305
    306306    /* this is const, no need to lock */
     
    314314    CheckComArgOutPointerValid(aVersion);
    315315
    316     AutoCaller autoCaller (this);
    317     CheckComRCReturnRC (autoCaller.rc());
     316    AutoCaller autoCaller(this);
     317    CheckComRCReturnRC(autoCaller.rc());
    318318
    319319    /* this is const, no need to lock */
     
    327327    CheckComArgOutPointerValid(aPortVersion);
    328328
    329     AutoCaller autoCaller (this);
    330     CheckComRCReturnRC (autoCaller.rc());
     329    AutoCaller autoCaller(this);
     330    CheckComRCReturnRC(autoCaller.rc());
    331331
    332332    /* this is const, no need to lock */
     
    340340    CheckComArgOutPointerValid(aRemote);
    341341
    342     AutoCaller autoCaller (this);
    343     CheckComRCReturnRC (autoCaller.rc());
     342    AutoCaller autoCaller(this);
     343    CheckComRCReturnRC(autoCaller.rc());
    344344
    345345    /* this is const, no need to lock */
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r21227 r21878  
    132132    int rc = RTSemEventWait (mCredentialsEvent, u32Timeout);
    133133
    134     if (RT_SUCCESS (rc))
     134    if (RT_SUCCESS(rc))
    135135    {
    136136        *pu32CredentialsFlags = mu32CredentialsFlags;
  • trunk/src/VBox/Main/VirtualBoxBase.cpp

    r21823 r21878  
    201201            ++ mInitUninitWaiters;
    202202
    203             LogFlowThisFunc ((mState == InInit ?
     203            LogFlowThisFunc((mState == InInit ?
    204204                              "Waiting for AutoInitSpan/AutoReinitSpan to "
    205205                              "finish...\n" :
     
    788788
    789789    /* these are mandatory, others -- not */
    790     AssertReturn ((!aWarning && FAILED (aResultCode)) ||
     790    AssertReturn((!aWarning && FAILED (aResultCode)) ||
    791791                  (aWarning && aResultCode != S_OK),
    792792                  E_FAIL);
    793     AssertReturn (!aText.isEmpty(), E_FAIL);
     793    AssertReturn(!aText.isEmpty(), E_FAIL);
    794794
    795795    /* reset the error severity bit if it's a warning */
     
    801801    do
    802802    {
    803         ComObjPtr <VirtualBoxErrorInfo> info;
     803        ComObjPtr<VirtualBoxErrorInfo> info;
    804804        rc = info.createObject();
    805805        CheckComRCBreakRC (rc);
     
    807807#if !defined (VBOX_WITH_XPCOM)
    808808
    809         ComPtr <IVirtualBoxErrorInfo> curInfo;
     809        ComPtr<IVirtualBoxErrorInfo> curInfo;
    810810        if (preserve)
    811811        {
    812812            /* get the current error info if any */
    813             ComPtr <IErrorInfo> err;
     813            ComPtr<IErrorInfo> err;
    814814            rc = ::GetErrorInfo (0, err.asOutParam());
    815815            CheckComRCBreakRC (rc);
    816             rc = err.queryInterfaceTo (curInfo.asOutParam());
     816            rc = err.queryInterfaceTo(curInfo.asOutParam());
    817817            if (FAILED (rc))
    818818            {
    819819                /* create a IVirtualBoxErrorInfo wrapper for the native
    820820                 * IErrorInfo object */
    821                 ComObjPtr <VirtualBoxErrorInfo> wrapper;
     821                ComObjPtr<VirtualBoxErrorInfo> wrapper;
    822822                rc = wrapper.createObject();
    823                 if (SUCCEEDED (rc))
     823                if (SUCCEEDED(rc))
    824824                {
    825825                    rc = wrapper->init (err);
    826                     if (SUCCEEDED (rc))
     826                    if (SUCCEEDED(rc))
    827827                        curInfo = wrapper;
    828828                }
     
    830830        }
    831831        /* On failure, curInfo will stay null */
    832         Assert (SUCCEEDED (rc) || curInfo.isNull());
     832        Assert (SUCCEEDED(rc) || curInfo.isNull());
    833833
    834834        /* set the current error info and preserve the previous one if any */
     
    836836        CheckComRCBreakRC (rc);
    837837
    838         ComPtr <IErrorInfo> err;
    839         rc = info.queryInterfaceTo (err.asOutParam());
    840         if (SUCCEEDED (rc))
     838        ComPtr<IErrorInfo> err;
     839        rc = info.queryInterfaceTo(err.asOutParam());
     840        if (SUCCEEDED(rc))
    841841            rc = ::SetErrorInfo (0, err);
    842842
     
    845845        nsCOMPtr <nsIExceptionService> es;
    846846        es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    847         if (NS_SUCCEEDED (rc))
     847        if (NS_SUCCEEDED(rc))
    848848        {
    849849            nsCOMPtr <nsIExceptionManager> em;
     
    851851            CheckComRCBreakRC (rc);
    852852
    853             ComPtr <IVirtualBoxErrorInfo> curInfo;
     853            ComPtr<IVirtualBoxErrorInfo> curInfo;
    854854            if (preserve)
    855855            {
    856856                /* get the current error info if any */
    857                 ComPtr <nsIException> ex;
     857                ComPtr<nsIException> ex;
    858858                rc = em->GetCurrentException (ex.asOutParam());
    859859                CheckComRCBreakRC (rc);
    860                 rc = ex.queryInterfaceTo (curInfo.asOutParam());
     860                rc = ex.queryInterfaceTo(curInfo.asOutParam());
    861861                if (FAILED (rc))
    862862                {
    863863                    /* create a IVirtualBoxErrorInfo wrapper for the native
    864864                     * nsIException object */
    865                     ComObjPtr <VirtualBoxErrorInfo> wrapper;
     865                    ComObjPtr<VirtualBoxErrorInfo> wrapper;
    866866                    rc = wrapper.createObject();
    867                     if (SUCCEEDED (rc))
     867                    if (SUCCEEDED(rc))
    868868                    {
    869869                        rc = wrapper->init (ex);
    870                         if (SUCCEEDED (rc))
     870                        if (SUCCEEDED(rc))
    871871                            curInfo = wrapper;
    872872                    }
     
    874874            }
    875875            /* On failure, curInfo will stay null */
    876             Assert (SUCCEEDED (rc) || curInfo.isNull());
     876            Assert (SUCCEEDED(rc) || curInfo.isNull());
    877877
    878878            /* set the current error info and preserve the previous one if any */
     
    880880            CheckComRCBreakRC (rc);
    881881
    882             ComPtr <nsIException> ex;
    883             rc = info.queryInterfaceTo (ex.asOutParam());
    884             if (SUCCEEDED (rc))
     882            ComPtr<nsIException> ex;
     883            rc = info.queryInterfaceTo(ex.asOutParam());
     884            if (SUCCEEDED(rc))
    885885                rc = em->SetCurrentException (ex);
    886886        }
     
    909909    AssertComRC (rc);
    910910
    911     return SUCCEEDED (rc) ? aResultCode : rc;
     911    return SUCCEEDED(rc) ? aResultCode : rc;
    912912}
    913913
     
    932932    LogFlowThisFuncEnter();
    933933
    934     AutoWriteLock alock (this);
     934    AutoWriteLock alock(this);
    935935    AutoWriteLock mapLock (mMapLock);
    936936
    937     LogFlowThisFunc (("count=%d...\n", mDependentChildren.size()));
     937    LogFlowThisFunc(("count=%d...\n", mDependentChildren.size()));
    938938
    939939    if (mDependentChildren.size())
     
    972972        alock.leave();
    973973
    974         LogFlowThisFunc (("Waiting for uninitialization of all children...\n"));
     974        LogFlowThisFunc(("Waiting for uninitialization of all children...\n"));
    975975
    976976        RTSemEventWait (mUninitDoneSem, RT_INDEFINITE_WAIT);
     
    994994 *
    995995 *  @param  unk
    996  *      Pointer to map to the dependent child object (it is ComPtr <IUnknown>
     996 *      Pointer to map to the dependent child object (it is ComPtr<IUnknown>
    997997 *      rather than IUnknown *, to guarantee IUnknown * identity)
    998998 *  @return
     
    10001000 */
    10011001VirtualBoxBase *VirtualBoxBaseWithChildren::getDependentChild (
    1002     const ComPtr <IUnknown> &unk)
    1003 {
    1004     AssertReturn (!!unk, NULL);
    1005 
    1006     AutoWriteLock alock (mMapLock);
     1002    const ComPtr<IUnknown> &unk)
     1003{
     1004    AssertReturn(!!unk, NULL);
     1005
     1006    AutoWriteLock alock(mMapLock);
    10071007    if (mUninitDoneSem != NIL_RTSEMEVENT)
    10081008        return NULL;
     
    10161016/** Helper for addDependentChild() template method */
    10171017void VirtualBoxBaseWithChildren::addDependentChild (
    1018     const ComPtr <IUnknown> &unk, VirtualBoxBase *child)
    1019 {
    1020     AssertReturn (!!unk && child, (void) 0);
    1021 
    1022     AutoWriteLock alock (mMapLock);
     1018    const ComPtr<IUnknown> &unk, VirtualBoxBase *child)
     1019{
     1020    AssertReturn(!!unk && child, (void) 0);
     1021
     1022    AutoWriteLock alock(mMapLock);
    10231023
    10241024    if (mUninitDoneSem != NIL_RTSEMEVENT)
     
    10361036
    10371037/** Helper for removeDependentChild() template method */
    1038 void VirtualBoxBaseWithChildren::removeDependentChild (const ComPtr <IUnknown> &unk)
     1038void VirtualBoxBaseWithChildren::removeDependentChild (const ComPtr<IUnknown> &unk)
    10391039{
    10401040    /// @todo (r=dmik) see todo in VirtualBoxBase.h, in
    10411041    //  template <class C> void removeDependentChild (C *child)
    10421042
    1043     AssertReturn (!!unk, (void) 0);
    1044 
    1045     AutoWriteLock alock (mMapLock);
     1043    AssertReturn(!!unk, (void) 0);
     1044
     1045    AutoWriteLock alock(mMapLock);
    10461046
    10471047    if (mUninitDoneSem != NIL_RTSEMEVENT)
     
    10901090void VirtualBoxBaseWithChildrenNEXT::uninitDependentChildren()
    10911091{
    1092     AutoCaller autoCaller (this);
     1092    AutoCaller autoCaller(this);
    10931093
    10941094    /* sanity */
     
    11051105         * be deleted while we've released the lock */
    11061106        DependentChildren::iterator it = mDependentChildren.begin();
    1107         ComPtr <IUnknown> unk = it->first;
     1107        ComPtr<IUnknown> unk = it->first;
    11081108        Assert (!unk.isNull());
    11091109
     
    11441144 * map of dependent children.
    11451145 *
    1146  * Note that ComPtr <IUnknown> is used as an argument instead of IUnknown * in
     1146 * Note that ComPtr<IUnknown> is used as an argument instead of IUnknown * in
    11471147 * order to guarantee IUnknown identity and disambiguation by doing
    11481148 * QueryInterface (IUnknown) rather than a regular C cast.
     
    11551155VirtualBoxBase* VirtualBoxBaseWithChildrenNEXT::getDependentChild(const ComPtr<IUnknown> &aUnk)
    11561156{
    1157     AssertReturn (!aUnk.isNull(), NULL);
    1158 
    1159     AutoCaller autoCaller (this);
     1157    AssertReturn(!aUnk.isNull(), NULL);
     1158
     1159    AutoCaller autoCaller(this);
    11601160
    11611161    /* return NULL if uninitDependentChildren() is in action */
     
    11631163        return NULL;
    11641164
    1165     AutoReadLock alock (childrenLock());
     1165    AutoReadLock alock(childrenLock());
    11661166
    11671167    DependentChildren::const_iterator it = mDependentChildren.find (aUnk);
     
    11791179    AssertReturnVoid (aChild != NULL);
    11801180
    1181     AutoCaller autoCaller (this);
     1181    AutoCaller autoCaller(this);
    11821182
    11831183    /* sanity */
     
    11861186                      autoCaller.state() == Limited);
    11871187
    1188     AutoWriteLock alock (childrenLock());
     1188    AutoWriteLock alock(childrenLock());
    11891189
    11901190    std::pair <DependentChildren::iterator, bool> result =
     
    11981198    AssertReturnVoid (aUnk);
    11991199
    1200     AutoCaller autoCaller (this);
     1200    AutoCaller autoCaller(this);
    12011201
    12021202    /* sanity */
     
    12061206                      autoCaller.state() == Limited);
    12071207
    1208     AutoWriteLock alock (childrenLock());
     1208    AutoWriteLock alock(childrenLock());
    12091209
    12101210    DependentChildren::size_type result = mDependentChildren.erase (aUnk);
  • trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp

    r21786 r21878  
    5454    CheckComArgOutPointerValid(aIID);
    5555
    56     mIID.toUtf16().cloneTo (aIID);
     56    mIID.toUtf16().cloneTo(aIID);
    5757    return S_OK;
    5858}
     
    6262    CheckComArgOutPointerValid(aComponent);
    6363
    64     mComponent.cloneTo (aComponent);
     64    mComponent.cloneTo(aComponent);
    6565    return S_OK;
    6666}
     
    7070    CheckComArgOutPointerValid(aText);
    7171
    72     mText.cloneTo (aText);
     72    mText.cloneTo(aText);
    7373    return S_OK;
    7474}
     
    7979
    8080    /* this will set aNext to NULL if mNext is null */
    81     return mNext.queryInterfaceTo (aNext);
     81    return mNext.queryInterfaceTo(aNext);
    8282}
    8383
     
    9090HRESULT VirtualBoxErrorInfo::init (IErrorInfo *aInfo)
    9191{
    92     AssertReturn (aInfo, E_FAIL);
     92    AssertReturn(aInfo, E_FAIL);
    9393
    9494    HRESULT rc = S_OK;
     
    149149HRESULT VirtualBoxErrorInfo::init (nsIException *aInfo)
    150150{
    151     AssertReturn (aInfo, E_FAIL);
     151    AssertReturn(aInfo, E_FAIL);
    152152
    153153    HRESULT rc = S_OK;
     
    176176    CheckComArgOutPointerValid(aMessage);
    177177
    178     Utf8Str (mText).cloneTo (aMessage);
     178    Utf8Str (mText).cloneTo(aMessage);
    179179    return S_OK;
    180180}
     
    226226NS_IMETHODIMP VirtualBoxErrorInfo::GetInner (nsIException **aInner)
    227227{
    228     ComPtr <IVirtualBoxErrorInfo> info;
     228    ComPtr<IVirtualBoxErrorInfo> info;
    229229    nsresult rv = COMGETTER(Next) (info.asOutParam());
    230     CheckComRCReturnRC (rv);
    231     return info.queryInterfaceTo (aInner);
     230    CheckComRCReturnRC(rv);
     231    return info.queryInterfaceTo(aInner);
    232232}
    233233
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r21607 r21878  
    136136HRESULT VirtualBox::FinalConstruct()
    137137{
    138     LogFlowThisFunc (("\n"));
     138    LogFlowThisFunc(("\n"));
    139139
    140140    return init();
     
    143143void VirtualBox::FinalRelease()
    144144{
    145     LogFlowThisFunc (("\n"));
     145    LogFlowThisFunc(("\n"));
    146146
    147147    uninit();
     
    163163{
    164164    /* Enclose the state transition NotReady->InInit->Ready */
    165     AutoInitSpan autoInitSpan (this);
    166     AssertReturn (autoInitSpan.isOk(), E_FAIL);
     165    AutoInitSpan autoInitSpan(this);
     166    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    167167
    168168    LogFlow (("===========================================================\n"));
     
    174174    if (sPackageType.isNull())
    175175        sPackageType = VBOX_PACKAGE_STRING;
    176     LogFlowThisFunc (("Version: %ls, Package: %ls\n", sVersion.raw(), sPackageType.raw()));
     176    LogFlowThisFunc(("Version: %ls, Package: %ls\n", sVersion.raw(), sPackageType.raw()));
    177177
    178178    if (sSettingsFormatVersion.isNull())
    179179        sSettingsFormatVersion = VBOX_XML_VERSION_FULL;
    180     LogFlowThisFunc (("Settings Format Version: %ls\n",
     180    LogFlowThisFunc(("Settings Format Version: %ls\n",
    181181                      sSettingsFormatVersion.raw()));
    182182
     
    185185        char homeDir [RTPATH_MAX];
    186186        int vrc = com::GetVBoxUserHomeDirectory (homeDir, sizeof (homeDir));
    187         if (RT_FAILURE (vrc))
     187        if (RT_FAILURE(vrc))
    188188            return setError (E_FAIL,
    189189                tr ("Could not create the VirtualBox home directory '%s'"
     
    191191                homeDir, vrc);
    192192
    193         unconst (mData.mHomeDir) = homeDir;
     193        unconst(mData.mHomeDir) = homeDir;
    194194    }
    195195
     
    199199
    200200    /* store the config file name */
    201     unconst (mData.mCfgFile.mName) = vboxConfigFile;
     201    unconst(mData.mCfgFile.mName) = vboxConfigFile;
    202202
    203203    /* lock the config file */
    204204    HRESULT rc = lockConfig();
    205     if (SUCCEEDED (rc))
     205    if (SUCCEEDED(rc))
    206206    {
    207207        if (!isConfigLocked())
     
    215215                                  RTFILE_O_READWRITE | RTFILE_O_CREATE |
    216216                                  RTFILE_O_DENY_WRITE);
    217             if (RT_SUCCESS (vrc))
     217            if (RT_SUCCESS(vrc))
    218218                vrc = RTFileWrite (handle,
    219219                                   (void *) gDefaultGlobalConfig,
    220220                                   strlen (gDefaultGlobalConfig), NULL);
    221             if (RT_FAILURE (vrc))
     221            if (RT_FAILURE(vrc))
    222222            {
    223223                rc = setError (E_FAIL, tr ("Could not create the default settings file "
     
    233233    }
    234234
    235     if (SUCCEEDED (rc))
     235    if (SUCCEEDED(rc))
    236236    {
    237237        try
     
    252252#ifdef VBOX_WITH_RESOURCE_USAGE_API
    253253            /* create the performance collector object BEFORE host */
    254             unconst (mData.mPerformanceCollector).createObject();
     254            unconst(mData.mPerformanceCollector).createObject();
    255255            rc = mData.mPerformanceCollector->init();
    256256            ComAssertComRCThrowRC (rc);
     
    258258
    259259            /* create the host object early, machines will need it */
    260             unconst (mData.mHost).createObject();
     260            unconst(mData.mHost).createObject();
    261261            rc = mData.mHost->init (this);
    262262            ComAssertComRCThrowRC (rc);
     
    266266
    267267            /* create the system properties object, someone may need it too */
    268             unconst (mData.mSystemProperties).createObject();
     268            unconst(mData.mSystemProperties).createObject();
    269269            rc = mData.mSystemProperties->init (this);
    270270            ComAssertComRCThrowRC (rc);
     
    276276            for (size_t i = 0; i < RT_ELEMENTS (Global::sOSTypes); ++ i)
    277277            {
    278                 ComObjPtr <GuestOSType> guestOSTypeObj;
     278                ComObjPtr<GuestOSType> guestOSTypeObj;
    279279                rc = guestOSTypeObj.createObject();
    280                 if (SUCCEEDED (rc))
     280                if (SUCCEEDED(rc))
    281281                {
    282282                    rc = guestOSTypeObj->init (Global::sOSTypes [i].familyId,
     
    291291                                               Global::sOSTypes [i].networkAdapterType,
    292292                                               Global::sOSTypes [i].numSerialEnabled);
    293                     if (SUCCEEDED (rc))
     293                    if (SUCCEEDED(rc))
    294294                        mData.mGuestOSTypes.push_back (guestOSTypeObj);
    295295                }
     
    312312/// @todo (r=dmik) add IVirtualBox::cleanupHardDisks() instead or similar
    313313//            for (HardDiskList::const_iterator it = mData.mHardDisks.begin();
    314 //                 it != mData.mHardDisks.end() && SUCCEEDED (rc);
     314//                 it != mData.mHardDisks.end() && SUCCEEDED(rc);
    315315//                 ++ it)
    316316//            {
     
    334334    }
    335335
    336     if (SUCCEEDED (rc))
     336    if (SUCCEEDED(rc))
    337337    {
    338338        /* start the client watcher thread */
    339339#if defined(RT_OS_WINDOWS)
    340         unconst (mWatcherData.mUpdateReq) = ::CreateEvent (NULL, FALSE, FALSE, NULL);
     340        unconst(mWatcherData.mUpdateReq) = ::CreateEvent (NULL, FALSE, FALSE, NULL);
    341341#elif defined(RT_OS_OS2)
    342         RTSemEventCreate (&unconst (mWatcherData.mUpdateReq));
     342        RTSemEventCreate (&unconst(mWatcherData.mUpdateReq));
    343343#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    344         RTSemEventCreate (&unconst (mWatcherData.mUpdateReq));
     344        RTSemEventCreate (&unconst(mWatcherData.mUpdateReq));
    345345#else
    346346# error "Port me!"
    347347#endif
    348         int vrc = RTThreadCreate (&unconst (mWatcherData.mThread),
     348        int vrc = RTThreadCreate (&unconst(mWatcherData.mThread),
    349349                                  ClientWatcher, (void *) this,
    350350                                  0, RTTHREADTYPE_MAIN_WORKER,
    351351                                  RTTHREADFLAGS_WAITABLE, "Watcher");
    352352        ComAssertRC (vrc);
    353         if (RT_FAILURE (vrc))
     353        if (RT_FAILURE(vrc))
    354354            rc = E_FAIL;
    355355    }
    356356
    357     if (SUCCEEDED (rc)) do
     357    if (SUCCEEDED(rc)) do
    358358    {
    359359        /* start the async event handler thread */
    360         int vrc = RTThreadCreate (&unconst (mAsyncEventThread), AsyncEventHandler,
    361                                   &unconst (mAsyncEventQ),
     360        int vrc = RTThreadCreate (&unconst(mAsyncEventThread), AsyncEventHandler,
     361                                  &unconst(mAsyncEventQ),
    362362                                  0, RTTHREADTYPE_MAIN_WORKER,
    363363                                  RTTHREADFLAGS_WAITABLE, "EventHandler");
     
    371371
    372372    /* Confirm a successful initialization when it's the case */
    373     if (SUCCEEDED (rc))
     373    if (SUCCEEDED(rc))
    374374        autoInitSpan.setSucceeded();
    375375
    376     LogFlowThisFunc (("rc=%08X\n", rc));
     376    LogFlowThisFunc(("rc=%08X\n", rc));
    377377    LogFlowThisFuncLeave();
    378378    LogFlow (("===========================================================\n"));
     
    383383{
    384384    /* Enclose the state transition Ready->InUninit->NotReady */
    385     AutoUninitSpan autoUninitSpan (this);
     385    AutoUninitSpan autoUninitSpan(this);
    386386    if (autoUninitSpan.uninitDone())
    387387        return;
     
    389389    LogFlow (("===========================================================\n"));
    390390    LogFlowThisFuncEnter();
    391     LogFlowThisFunc (("initFailed()=%d\n", autoUninitSpan.initFailed()));
     391    LogFlowThisFunc(("initFailed()=%d\n", autoUninitSpan.initFailed()));
    392392
    393393    /* tell all our child objects we've been uninitialized */
    394394
    395     LogFlowThisFunc (("Uninitializing machines (%d)...\n", mData.mMachines.size()));
     395    LogFlowThisFunc(("Uninitializing machines (%d)...\n", mData.mMachines.size()));
    396396    if (mData.mMachines.size())
    397397    {
     
    426426    {
    427427        mData.mSystemProperties->uninit();
    428         unconst (mData.mSystemProperties).setNull();
     428        unconst(mData.mSystemProperties).setNull();
    429429    }
    430430
     
    432432    {
    433433        mData.mHost->uninit();
    434         unconst (mData.mHost).setNull();
     434        unconst(mData.mHost).setNull();
    435435    }
    436436
     
    439439    {
    440440        mData.mPerformanceCollector->uninit();
    441         unconst (mData.mPerformanceCollector).setNull();
     441        unconst(mData.mPerformanceCollector).setNull();
    442442    }
    443443#endif /* VBOX_WITH_RESOURCE_USAGE_API */
     
    446446    unlockConfig();
    447447
    448     LogFlowThisFunc (("Releasing callbacks...\n"));
     448    LogFlowThisFunc(("Releasing callbacks...\n"));
    449449    if (mData.mCallbacks.size())
    450450    {
     
    455455    }
    456456
    457     LogFlowThisFunc (("Terminating the async event handler...\n"));
     457    LogFlowThisFunc(("Terminating the async event handler...\n"));
    458458    if (mAsyncEventThread != NIL_RTTHREAD)
    459459    {
     
    466466             */
    467467            int vrc = RTThreadWait (mAsyncEventThread, 60000, NULL);
    468             if (RT_FAILURE (vrc))
     468            if (RT_FAILURE(vrc))
    469469                LogWarningFunc (("RTThreadWait(%RTthrd) -> %Rrc\n",
    470470                                 mAsyncEventThread, vrc));
     
    476476        }
    477477
    478         unconst (mAsyncEventThread) = NIL_RTTHREAD;
    479         unconst (mAsyncEventQ) = NULL;
    480     }
    481 
    482     LogFlowThisFunc (("Terminating the client watcher...\n"));
     478        unconst(mAsyncEventThread) = NIL_RTTHREAD;
     479        unconst(mAsyncEventQ) = NULL;
     480    }
     481
     482    LogFlowThisFunc(("Terminating the client watcher...\n"));
    483483    if (mWatcherData.mThread != NIL_RTTHREAD)
    484484    {
     
    487487        /* wait for the termination */
    488488        RTThreadWait (mWatcherData.mThread, RT_INDEFINITE_WAIT, NULL);
    489         unconst (mWatcherData.mThread) = NIL_RTTHREAD;
     489        unconst(mWatcherData.mThread) = NIL_RTTHREAD;
    490490    }
    491491    mWatcherData.mProcesses.clear();
     
    494494    {
    495495        ::CloseHandle (mWatcherData.mUpdateReq);
    496         unconst (mWatcherData.mUpdateReq) = NULL;
     496        unconst(mWatcherData.mUpdateReq) = NULL;
    497497    }
    498498#elif defined(RT_OS_OS2)
     
    500500    {
    501501        RTSemEventDestroy (mWatcherData.mUpdateReq);
    502         unconst (mWatcherData.mUpdateReq) = NIL_RTSEMEVENT;
     502        unconst(mWatcherData.mUpdateReq) = NIL_RTSEMEVENT;
    503503    }
    504504#elif defined(VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
     
    506506    {
    507507        RTSemEventDestroy (mWatcherData.mUpdateReq);
    508         unconst (mWatcherData.mUpdateReq) = NIL_RTSEMEVENT;
     508        unconst(mWatcherData.mUpdateReq) = NIL_RTSEMEVENT;
    509509    }
    510510#else
     
    526526    CheckComArgNotNull(aVersion);
    527527
    528     AutoCaller autoCaller (this);
    529     CheckComRCReturnRC (autoCaller.rc());
    530 
    531     sVersion.cloneTo (aVersion);
     528    AutoCaller autoCaller(this);
     529    CheckComRCReturnRC(autoCaller.rc());
     530
     531    sVersion.cloneTo(aVersion);
    532532    return S_OK;
    533533}
     
    537537    CheckComArgNotNull(aRevision);
    538538
    539     AutoCaller autoCaller (this);
    540     CheckComRCReturnRC (autoCaller.rc());
     539    AutoCaller autoCaller(this);
     540    CheckComRCReturnRC(autoCaller.rc());
    541541
    542542    *aRevision = sRevision;
     
    548548    CheckComArgNotNull(aPackageType);
    549549
    550     AutoCaller autoCaller (this);
    551     CheckComRCReturnRC (autoCaller.rc());
    552 
    553     sPackageType.cloneTo (aPackageType);
     550    AutoCaller autoCaller(this);
     551    CheckComRCReturnRC(autoCaller.rc());
     552
     553    sPackageType.cloneTo(aPackageType);
    554554    return S_OK;
    555555}
     
    559559    CheckComArgNotNull(aHomeFolder);
    560560
    561     AutoCaller autoCaller (this);
    562     CheckComRCReturnRC (autoCaller.rc());
     561    AutoCaller autoCaller(this);
     562    CheckComRCReturnRC(autoCaller.rc());
    563563
    564564    /* mHomeDir is const and doesn't need a lock */
    565     mData.mHomeDir.cloneTo (aHomeFolder);
     565    mData.mHomeDir.cloneTo(aHomeFolder);
    566566    return S_OK;
    567567}
     
    571571    CheckComArgNotNull(aSettingsFilePath);
    572572
    573     AutoCaller autoCaller (this);
    574     CheckComRCReturnRC (autoCaller.rc());
     573    AutoCaller autoCaller(this);
     574    CheckComRCReturnRC(autoCaller.rc());
    575575
    576576    /* mCfgFile.mName is const and doesn't need a lock */
    577     mData.mCfgFile.mName.cloneTo (aSettingsFilePath);
     577    mData.mCfgFile.mName.cloneTo(aSettingsFilePath);
    578578    return S_OK;
    579579}
     
    584584    CheckComArgNotNull(aSettingsFileVersion);
    585585
    586     AutoCaller autoCaller (this);
    587     CheckComRCReturnRC (autoCaller.rc());
    588 
    589     AutoReadLock alock (this);
    590 
    591     mData.mSettingsFileVersion.cloneTo (aSettingsFileVersion);
     586    AutoCaller autoCaller(this);
     587    CheckComRCReturnRC(autoCaller.rc());
     588
     589    AutoReadLock alock(this);
     590
     591    mData.mSettingsFileVersion.cloneTo(aSettingsFileVersion);
    592592    return S_OK;
    593593}
     
    598598    CheckComArgNotNull(aSettingsFormatVersion);
    599599
    600     AutoCaller autoCaller (this);
    601     CheckComRCReturnRC (autoCaller.rc());
    602 
    603     sSettingsFormatVersion.cloneTo (aSettingsFormatVersion);
     600    AutoCaller autoCaller(this);
     601    CheckComRCReturnRC(autoCaller.rc());
     602
     603    sSettingsFormatVersion.cloneTo(aSettingsFormatVersion);
    604604    return S_OK;
    605605}
     
    609609    CheckComArgOutSafeArrayPointerValid(aHost);
    610610
    611     AutoCaller autoCaller (this);
    612     CheckComRCReturnRC (autoCaller.rc());
     611    AutoCaller autoCaller(this);
     612    CheckComRCReturnRC(autoCaller.rc());
    613613
    614614    /* mHost is const, no need to lock */
    615     mData.mHost.queryInterfaceTo (aHost);
     615    mData.mHost.queryInterfaceTo(aHost);
    616616    return S_OK;
    617617}
     
    622622    CheckComArgOutSafeArrayPointerValid(aSystemProperties);
    623623
    624     AutoCaller autoCaller (this);
    625     CheckComRCReturnRC (autoCaller.rc());
     624    AutoCaller autoCaller(this);
     625    CheckComRCReturnRC(autoCaller.rc());
    626626
    627627    /* mSystemProperties is const, no need to lock */
    628     mData.mSystemProperties.queryInterfaceTo (aSystemProperties);
     628    mData.mSystemProperties.queryInterfaceTo(aSystemProperties);
    629629    return S_OK;
    630630}
    631631
    632632STDMETHODIMP
    633 VirtualBox::COMGETTER(Machines) (ComSafeArrayOut (IMachine *, aMachines))
    634 {
    635     if (ComSafeArrayOutIsNull (aMachines))
     633VirtualBox::COMGETTER(Machines) (ComSafeArrayOut(IMachine *, aMachines))
     634{
     635    if (ComSafeArrayOutIsNull(aMachines))
    636636        return E_POINTER;
    637637
    638     AutoCaller autoCaller (this);
    639     CheckComRCReturnRC (autoCaller.rc());
    640 
    641     AutoReadLock alock (this);
    642 
    643     SafeIfaceArray <IMachine> machines (mData.mMachines);
    644     machines.detachTo (ComSafeArrayOutArg (aMachines));
     638    AutoCaller autoCaller(this);
     639    CheckComRCReturnRC(autoCaller.rc());
     640
     641    AutoReadLock alock(this);
     642
     643    SafeIfaceArray<IMachine> machines (mData.mMachines);
     644    machines.detachTo(ComSafeArrayOutArg(aMachines));
    645645
    646646    return S_OK;
    647647}
    648648
    649 STDMETHODIMP VirtualBox::COMGETTER(HardDisks) (ComSafeArrayOut (IHardDisk *, aHardDisks))
    650 {
    651     if (ComSafeArrayOutIsNull (aHardDisks))
     649STDMETHODIMP VirtualBox::COMGETTER(HardDisks) (ComSafeArrayOut(IHardDisk *, aHardDisks))
     650{
     651    if (ComSafeArrayOutIsNull(aHardDisks))
    652652        return E_POINTER;
    653653
    654     AutoCaller autoCaller (this);
    655     CheckComRCReturnRC (autoCaller.rc());
    656 
    657     AutoReadLock alock (this);
     654    AutoCaller autoCaller(this);
     655    CheckComRCReturnRC(autoCaller.rc());
     656
     657    AutoReadLock alock(this);
    658658
    659659    SafeIfaceArray<IHardDisk> hardDisks (mData.mHardDisks);
    660     hardDisks.detachTo (ComSafeArrayOutArg (aHardDisks));
     660    hardDisks.detachTo(ComSafeArrayOutArg(aHardDisks));
    661661
    662662    return S_OK;
     
    664664
    665665STDMETHODIMP
    666 VirtualBox::COMGETTER(DVDImages) (ComSafeArrayOut (IDVDImage *, aDVDImages))
    667 {
    668     if (ComSafeArrayOutIsNull (aDVDImages))
     666VirtualBox::COMGETTER(DVDImages) (ComSafeArrayOut(IDVDImage *, aDVDImages))
     667{
     668    if (ComSafeArrayOutIsNull(aDVDImages))
    669669        return E_POINTER;
    670670
    671     AutoCaller autoCaller (this);
    672     CheckComRCReturnRC (autoCaller.rc());
    673 
    674     AutoReadLock alock (this);
    675 
    676     SafeIfaceArray <IDVDImage> images (mData.mDVDImages);
    677     images.detachTo (ComSafeArrayOutArg (aDVDImages));
     671    AutoCaller autoCaller(this);
     672    CheckComRCReturnRC(autoCaller.rc());
     673
     674    AutoReadLock alock(this);
     675
     676    SafeIfaceArray<IDVDImage> images (mData.mDVDImages);
     677    images.detachTo(ComSafeArrayOutArg(aDVDImages));
    678678
    679679    return S_OK;
     
    683683VirtualBox::COMGETTER(FloppyImages) (ComSafeArrayOut(IFloppyImage *, aFloppyImages))
    684684{
    685     if (ComSafeArrayOutIsNull (aFloppyImages))
     685    if (ComSafeArrayOutIsNull(aFloppyImages))
    686686        return E_POINTER;
    687687
    688     AutoCaller autoCaller (this);
    689     CheckComRCReturnRC (autoCaller.rc());
    690 
    691     AutoReadLock alock (this);
     688    AutoCaller autoCaller(this);
     689    CheckComRCReturnRC(autoCaller.rc());
     690
     691    AutoReadLock alock(this);
    692692
    693693    SafeIfaceArray<IFloppyImage> images (mData.mFloppyImages);
    694     images.detachTo (ComSafeArrayOutArg (aFloppyImages));
     694    images.detachTo(ComSafeArrayOutArg(aFloppyImages));
    695695
    696696    return S_OK;
    697697}
    698698
    699 STDMETHODIMP VirtualBox::COMGETTER(ProgressOperations) (ComSafeArrayOut (IProgress *, aOperations))
     699STDMETHODIMP VirtualBox::COMGETTER(ProgressOperations) (ComSafeArrayOut(IProgress *, aOperations))
    700700{
    701701    CheckComArgOutSafeArrayPointerValid(aOperations);
    702702
    703     AutoCaller autoCaller (this);
    704     CheckComRCReturnRC (autoCaller.rc());
     703    AutoCaller autoCaller(this);
     704    CheckComRCReturnRC(autoCaller.rc());
    705705
    706706    /* protect mProgressOperations */
    707707    AutoReadLock safeLock (mSafeLock);
    708708
    709     SafeIfaceArray <IProgress> progress (mData.mProgressOperations);
    710     progress.detachTo (ComSafeArrayOutArg (aOperations));
     709    SafeIfaceArray<IProgress> progress (mData.mProgressOperations);
     710    progress.detachTo(ComSafeArrayOutArg(aOperations));
    711711
    712712    return S_OK;
    713713}
    714714
    715 STDMETHODIMP VirtualBox::COMGETTER(GuestOSTypes) (ComSafeArrayOut (IGuestOSType *, aGuestOSTypes))
     715STDMETHODIMP VirtualBox::COMGETTER(GuestOSTypes) (ComSafeArrayOut(IGuestOSType *, aGuestOSTypes))
    716716{
    717717    CheckComArgOutSafeArrayPointerValid(aGuestOSTypes);
    718718
    719     AutoCaller autoCaller (this);
    720     CheckComRCReturnRC (autoCaller.rc());
    721 
    722     AutoReadLock alock (this);
    723 
    724     SafeIfaceArray <IGuestOSType> ostypes (mData.mGuestOSTypes);
    725     ostypes.detachTo (ComSafeArrayOutArg (aGuestOSTypes));
     719    AutoCaller autoCaller(this);
     720    CheckComRCReturnRC(autoCaller.rc());
     721
     722    AutoReadLock alock(this);
     723
     724    SafeIfaceArray<IGuestOSType> ostypes (mData.mGuestOSTypes);
     725    ostypes.detachTo(ComSafeArrayOutArg(aGuestOSTypes));
    726726
    727727    return S_OK;
     
    729729
    730730STDMETHODIMP
    731 VirtualBox::COMGETTER(SharedFolders) (ComSafeArrayOut (ISharedFolder *, aSharedFolders))
     731VirtualBox::COMGETTER(SharedFolders) (ComSafeArrayOut(ISharedFolder *, aSharedFolders))
    732732{
    733733#ifndef RT_OS_WINDOWS
     
    737737    CheckComArgOutSafeArrayPointerValid(aSharedFolders);
    738738
    739     AutoCaller autoCaller (this);
    740     CheckComRCReturnRC (autoCaller.rc());
     739    AutoCaller autoCaller(this);
     740    CheckComRCReturnRC(autoCaller.rc());
    741741
    742742    return setError (E_NOTIMPL, "Not yet implemented");
     
    749749    CheckComArgOutSafeArrayPointerValid(aPerformanceCollector);
    750750
    751     AutoCaller autoCaller (this);
    752     CheckComRCReturnRC (autoCaller.rc());
     751    AutoCaller autoCaller(this);
     752    CheckComRCReturnRC(autoCaller.rc());
    753753
    754754    /* mPerformanceCollector is const, no need to lock */
    755     mData.mPerformanceCollector.queryInterfaceTo (aPerformanceCollector);
     755    mData.mPerformanceCollector.queryInterfaceTo(aPerformanceCollector);
    756756
    757757    return S_OK;
     
    762762
    763763STDMETHODIMP
    764 VirtualBox::COMGETTER(DHCPServers) (ComSafeArrayOut (IDHCPServer *, aDHCPServers))
    765 {
    766     if (ComSafeArrayOutIsNull (aDHCPServers))
     764VirtualBox::COMGETTER(DHCPServers) (ComSafeArrayOut(IDHCPServer *, aDHCPServers))
     765{
     766    if (ComSafeArrayOutIsNull(aDHCPServers))
    767767        return E_POINTER;
    768768
    769     AutoCaller autoCaller (this);
    770     CheckComRCReturnRC (autoCaller.rc());
    771 
    772     AutoReadLock alock (this);
     769    AutoCaller autoCaller(this);
     770    CheckComRCReturnRC(autoCaller.rc());
     771
     772    AutoReadLock alock(this);
    773773
    774774    SafeIfaceArray<IDHCPServer> svrs (mData.mDHCPServers);
    775     svrs.detachTo (ComSafeArrayOutArg (aDHCPServers));
     775    svrs.detachTo(ComSafeArrayOutArg(aDHCPServers));
    776776
    777777    return S_OK;
     
    789789{
    790790    LogFlowThisFuncEnter();
    791     LogFlowThisFunc (("aName=\"%ls\",aOsTypeId =\"%ls\",aBaseFolder=\"%ls\"\n", aName, aOsTypeId, aBaseFolder));
     791    LogFlowThisFunc(("aName=\"%ls\",aOsTypeId =\"%ls\",aBaseFolder=\"%ls\"\n", aName, aOsTypeId, aBaseFolder));
    792792
    793793    CheckComArgStrNotEmptyOrNull (aName);
    794794    /** @todo tighten checks on aId? */
    795     CheckComArgOutPointerValid (aMachine);
    796 
    797     AutoCaller autoCaller (this);
    798     CheckComRCReturnRC (autoCaller.rc());
     795    CheckComArgOutPointerValid(aMachine);
     796
     797    AutoCaller autoCaller(this);
     798    CheckComRCReturnRC(autoCaller.rc());
    799799
    800800    /* Compose the settings file name using the following scheme:
     
    819819
    820820    /* create a new object */
    821     ComObjPtr <Machine> machine;
     821    ComObjPtr<Machine> machine;
    822822    rc = machine.createObject();
    823     CheckComRCReturnRC (rc);
     823    CheckComRCReturnRC(rc);
    824824
    825825    /* Create UUID if an empty one was specified. */
     
    853853    rc = machine->init (this, settingsFile, Machine::Init_New, aName, osType,
    854854                        TRUE /* aNameSync */, &id);
    855     if (SUCCEEDED (rc))
     855    if (SUCCEEDED(rc))
    856856    {
    857857        /* set the return value */
    858         rc = machine.queryInterfaceTo (aMachine);
     858        rc = machine.queryInterfaceTo(aMachine);
    859859        AssertComRC (rc);
    860860    }
     
    874874    CheckComArgStrNotEmptyOrNull (aSettingsFile);
    875875    /** @todo tighten checks on aId? */
    876     CheckComArgOutPointerValid (aMachine);
    877 
    878     AutoCaller autoCaller (this);
    879     CheckComRCReturnRC (autoCaller.rc());
     876    CheckComArgOutPointerValid(aMachine);
     877
     878    AutoCaller autoCaller(this);
     879    CheckComRCReturnRC(autoCaller.rc());
    880880
    881881    HRESULT rc = E_FAIL;
     
    889889    ComObjPtr<Machine> machine;
    890890    rc = machine.createObject();
    891     CheckComRCReturnRC (rc);
     891    CheckComRCReturnRC(rc);
    892892
    893893    /* Create UUID if an empty one was specified. */
     
    921921    rc = machine->init (this, Bstr (settingsFile), Machine::Init_New,
    922922                        aName, osType, FALSE /* aNameSync */, &id);
    923     if (SUCCEEDED (rc))
     923    if (SUCCEEDED(rc))
    924924    {
    925925        /* set the return value */
    926         rc = machine.queryInterfaceTo (aMachine);
     926        rc = machine.queryInterfaceTo(aMachine);
    927927        AssertComRC (rc);
    928928    }
     
    937937    CheckComArgOutSafeArrayPointerValid(aMachine);
    938938
    939     AutoCaller autoCaller (this);
    940     CheckComRCReturnRC (autoCaller.rc());
     939    AutoCaller autoCaller(this);
     940    CheckComRCReturnRC(autoCaller.rc());
    941941
    942942    HRESULT rc = E_FAIL;
     
    945945    ComObjPtr<Machine> machine;
    946946    rc = machine.createObject();
    947     if (SUCCEEDED (rc))
     947    if (SUCCEEDED(rc))
    948948    {
    949949        /* initialize the machine object */
    950950        rc = machine->init (this, aSettingsFile, Machine::Init_Existing);
    951         if (SUCCEEDED (rc))
     951        if (SUCCEEDED(rc))
    952952        {
    953953            /* set the return value */
    954             rc = machine.queryInterfaceTo (aMachine);
     954            rc = machine.queryInterfaceTo(aMachine);
    955955            ComAssertComRC (rc);
    956956        }
     
    965965    CheckComArgNotNull(aMachine);
    966966
    967     AutoCaller autoCaller (this);
    968     CheckComRCReturnRC (autoCaller.rc());
     967    AutoCaller autoCaller(this);
     968    CheckComRCReturnRC(autoCaller.rc());
    969969
    970970    HRESULT rc;
     
    972972    Bstr name;
    973973    rc = aMachine->COMGETTER(Name) (name.asOutParam());
    974     CheckComRCReturnRC (rc);
     974    CheckComRCReturnRC(rc);
    975975
    976976    /* We need the children map lock here to keep the getDependentChild() result
     
    996996
    997997    /* fire an event */
    998     if (SUCCEEDED (rc))
     998    if (SUCCEEDED(rc))
    999999        onMachineRegistered (machine->id(), TRUE);
    10001000
     
    10071007    CheckComArgOutSafeArrayPointerValid(aMachine);
    10081008
    1009     AutoCaller autoCaller (this);
    1010     CheckComRCReturnRC (autoCaller.rc());
    1011 
    1012     ComObjPtr <Machine> machine;
     1009    AutoCaller autoCaller(this);
     1010    CheckComRCReturnRC(autoCaller.rc());
     1011
     1012    ComObjPtr<Machine> machine;
    10131013    HRESULT rc = findMachine (Guid (aId), true /* setError */, &machine);
    10141014
    10151015    /* the below will set *aMachine to NULL if machine is null */
    1016     machine.queryInterfaceTo (aMachine);
     1016    machine.queryInterfaceTo(aMachine);
    10171017
    10181018    return rc;
     
    10231023{
    10241024    LogFlowThisFuncEnter();
    1025     LogFlowThisFunc (("aName=\"%ls\", aMachine={%p}\n", aName, aMachine));
     1025    LogFlowThisFunc(("aName=\"%ls\", aMachine={%p}\n", aName, aMachine));
    10261026
    10271027    CheckComArgNotNull(aName);
    10281028    CheckComArgOutSafeArrayPointerValid(aMachine);
    10291029
    1030     AutoCaller autoCaller (this);
    1031     CheckComRCReturnRC (autoCaller.rc());
     1030    AutoCaller autoCaller(this);
     1031    CheckComRCReturnRC(autoCaller.rc());
    10321032
    10331033    /* start with not found */
    1034     ComObjPtr <Machine> machine;
     1034    ComObjPtr<Machine> machine;
    10351035    MachineList machines;
    10361036    {
    10371037        /* take a copy for safe iteration outside the lock */
    1038         AutoReadLock alock (this);
     1038        AutoReadLock alock(this);
    10391039        machines = mData.mMachines;
    10401040    }
     
    10571057
    10581058    /* this will set (*machine) to NULL if machineObj is null */
    1059     machine.queryInterfaceTo (aMachine);
     1059    machine.queryInterfaceTo(aMachine);
    10601060
    10611061    HRESULT rc = machine
     
    10641064            tr ("Could not find a registered machine named '%ls'"), aName);
    10651065
    1066     LogFlowThisFunc (("rc=%08X\n", rc));
     1066    LogFlowThisFunc(("rc=%08X\n", rc));
    10671067    LogFlowThisFuncLeave();
    10681068
     
    10781078        return E_INVALIDARG;
    10791079
    1080     AutoCaller autoCaller (this);
    1081     CheckComRCReturnRC (autoCaller.rc());
    1082 
    1083     AutoWriteLock alock (this);
    1084 
    1085     ComObjPtr <Machine> machine;
     1080    AutoCaller autoCaller(this);
     1081    CheckComRCReturnRC(autoCaller.rc());
     1082
     1083    AutoWriteLock alock(this);
     1084
     1085    ComObjPtr<Machine> machine;
    10861086
    10871087    HRESULT rc = findMachine (id, true /* setError */, &machine);
    1088     CheckComRCReturnRC (rc);
     1088    CheckComRCReturnRC(rc);
    10891089
    10901090    rc = machine->trySetRegistered (FALSE);
    1091     CheckComRCReturnRC (rc);
     1091    CheckComRCReturnRC(rc);
    10921092
    10931093    /* remove from the collection of registered machines */
     
    10981098
    10991099    /* return the unregistered machine to the caller */
    1100     machine.queryInterfaceTo (aMachine);
     1100    machine.queryInterfaceTo(aMachine);
    11011101
    11021102    /* fire an event */
     
    11101110                                        IHardDisk **aHardDisk)
    11111111{
    1112     CheckComArgOutPointerValid (aHardDisk);
    1113 
    1114     AutoCaller autoCaller (this);
    1115     CheckComRCReturnRC (autoCaller.rc());
     1112    CheckComArgOutPointerValid(aHardDisk);
     1113
     1114    AutoCaller autoCaller(this);
     1115    CheckComRCReturnRC(autoCaller.rc());
    11161116
    11171117    /* we don't access non-const data members so no need to lock */
     
    11301130    rc = hardDisk->init(this, format, aLocation);
    11311131
    1132     if (SUCCEEDED (rc))
    1133         hardDisk.queryInterfaceTo (aHardDisk);
     1132    if (SUCCEEDED(rc))
     1133        hardDisk.queryInterfaceTo(aHardDisk);
    11341134
    11351135    return rc;
     
    11471147    CheckComArgOutSafeArrayPointerValid(aHardDisk);
    11481148
    1149     AutoCaller autoCaller (this);
    1150     CheckComRCReturnRC (autoCaller.rc());
     1149    AutoCaller autoCaller(this);
     1150    CheckComRCReturnRC(autoCaller.rc());
    11511151
    11521152    /* we don't access non-const data members so no need to lock */
     
    11711171                        aSetParentId, parentId);
    11721172
    1173     if (SUCCEEDED (rc))
     1173    if (SUCCEEDED(rc))
    11741174    {
    11751175        rc = registerHardDisk (hardDisk);
     
    11791179         * with the parent and this association needs to be broken. */
    11801180
    1181         if (SUCCEEDED (rc))
    1182             hardDisk.queryInterfaceTo (aHardDisk);
     1181        if (SUCCEEDED(rc))
     1182            hardDisk.queryInterfaceTo(aHardDisk);
    11831183        else
    11841184            hardDisk->uninit();
     
    11931193    CheckComArgOutSafeArrayPointerValid(aHardDisk);
    11941194
    1195     AutoCaller autoCaller (this);
    1196     CheckComRCReturnRC (autoCaller.rc());
     1195    AutoCaller autoCaller(this);
     1196    CheckComRCReturnRC(autoCaller.rc());
    11971197
    11981198    Guid id(aId);
     
    12011201
    12021202    /* the below will set *aHardDisk to NULL if hardDisk is null */
    1203     hardDisk.queryInterfaceTo (aHardDisk);
     1203    hardDisk.queryInterfaceTo(aHardDisk);
    12041204
    12051205    return rc;
     
    12121212    CheckComArgOutSafeArrayPointerValid(aHardDisk);
    12131213
    1214     AutoCaller autoCaller (this);
    1215     CheckComRCReturnRC (autoCaller.rc());
     1214    AutoCaller autoCaller(this);
     1215    CheckComRCReturnRC(autoCaller.rc());
    12161216
    12171217    ComObjPtr<HardDisk> hardDisk;
     
    12191219
    12201220    /* the below will set *aHardDisk to NULL if hardDisk is null */
    1221     hardDisk.queryInterfaceTo (aHardDisk);
     1221    hardDisk.queryInterfaceTo(aHardDisk);
    12221222
    12231223    return rc;
     
    12311231    CheckComArgOutSafeArrayPointerValid(aDVDImage);
    12321232
    1233     AutoCaller autoCaller (this);
    1234     CheckComRCReturnRC (autoCaller.rc());
     1233    AutoCaller autoCaller(this);
     1234    CheckComRCReturnRC(autoCaller.rc());
    12351235
    12361236    HRESULT rc = VBOX_E_FILE_ERROR;
     
    12411241        id.create();
    12421242
    1243     ComObjPtr <DVDImage> image;
     1243    ComObjPtr<DVDImage> image;
    12441244    image.createObject();
    12451245    rc = image->init (this, aLocation, id);
    1246     if (SUCCEEDED (rc))
     1246    if (SUCCEEDED(rc))
    12471247    {
    12481248        rc = registerDVDImage (image);
    12491249
    1250         if (SUCCEEDED (rc))
    1251             image.queryInterfaceTo (aDVDImage);
     1250        if (SUCCEEDED(rc))
     1251            image.queryInterfaceTo(aDVDImage);
    12521252    }
    12531253
     
    12601260    CheckComArgOutSafeArrayPointerValid(aDVDImage);
    12611261
    1262     AutoCaller autoCaller (this);
    1263     CheckComRCReturnRC (autoCaller.rc());
     1262    AutoCaller autoCaller(this);
     1263    CheckComRCReturnRC(autoCaller.rc());
    12641264
    12651265    Guid id(aId);
    1266     ComObjPtr <DVDImage> image;
     1266    ComObjPtr<DVDImage> image;
    12671267    HRESULT rc = findDVDImage (&id, NULL, true /* setError */, &image);
    12681268
    12691269    /* the below will set *aDVDImage to NULL if image is null */
    1270     image.queryInterfaceTo (aDVDImage);
     1270    image.queryInterfaceTo(aDVDImage);
    12711271
    12721272    return rc;
     
    12791279    CheckComArgOutSafeArrayPointerValid(aDVDImage);
    12801280
    1281     AutoCaller autoCaller (this);
    1282     CheckComRCReturnRC (autoCaller.rc());
    1283 
    1284     ComObjPtr <DVDImage> image;
     1281    AutoCaller autoCaller(this);
     1282    CheckComRCReturnRC(autoCaller.rc());
     1283
     1284    ComObjPtr<DVDImage> image;
    12851285    HRESULT rc = findDVDImage (NULL, aLocation, true /* setError */, &image);
    12861286
    12871287    /* the below will set *aDVDImage to NULL if dvd is null */
    1288     image.queryInterfaceTo (aDVDImage);
     1288    image.queryInterfaceTo(aDVDImage);
    12891289
    12901290    return rc;
     
    12981298    CheckComArgOutSafeArrayPointerValid(aFloppyImage);
    12991299
    1300     AutoCaller autoCaller (this);
    1301     CheckComRCReturnRC (autoCaller.rc());
     1300    AutoCaller autoCaller(this);
     1301    CheckComRCReturnRC(autoCaller.rc());
    13021302
    13031303    HRESULT rc = VBOX_E_FILE_ERROR;
     
    13111311    image.createObject();
    13121312    rc = image->init (this, aLocation, id);
    1313     if (SUCCEEDED (rc))
     1313    if (SUCCEEDED(rc))
    13141314    {
    13151315        rc = registerFloppyImage (image);
    13161316
    1317         if (SUCCEEDED (rc))
    1318             image.queryInterfaceTo (aFloppyImage);
     1317        if (SUCCEEDED(rc))
     1318            image.queryInterfaceTo(aFloppyImage);
    13191319    }
    13201320
     
    13291329    CheckComArgOutSafeArrayPointerValid(aFloppyImage);
    13301330
    1331     AutoCaller autoCaller (this);
    1332     CheckComRCReturnRC (autoCaller.rc());
     1331    AutoCaller autoCaller(this);
     1332    CheckComRCReturnRC(autoCaller.rc());
    13331333
    13341334    Guid id(aId);
     
    13371337
    13381338    /* the below will set *aFloppyImage to NULL if image is null */
    1339     image.queryInterfaceTo (aFloppyImage);
     1339    image.queryInterfaceTo(aFloppyImage);
    13401340
    13411341    return rc;
     
    13491349    CheckComArgOutSafeArrayPointerValid(aFloppyImage);
    13501350
    1351     AutoCaller autoCaller (this);
    1352     CheckComRCReturnRC (autoCaller.rc());
     1351    AutoCaller autoCaller(this);
     1352    CheckComRCReturnRC(autoCaller.rc());
    13531353
    13541354    ComObjPtr<FloppyImage> image;
     
    13561356
    13571357    /* the below will set *aFloppyImage to NULL if img is null */
    1358     image.queryInterfaceTo (aFloppyImage);
     1358    image.queryInterfaceTo(aFloppyImage);
    13591359
    13601360    return rc;
     
    13851385    CheckComArgNotNull (aType);
    13861386
    1387     AutoCaller autoCaller (this);
    1388     CheckComRCReturnRC (autoCaller.rc());
     1387    AutoCaller autoCaller(this);
     1388    CheckComRCReturnRC(autoCaller.rc());
    13891389
    13901390    /* first, look for a substitution */
     
    14011401    *aType = NULL;
    14021402
    1403     AutoReadLock alock (this);
     1403    AutoReadLock alock(this);
    14041404
    14051405    for (GuestOSTypeList::iterator it = mData.mGuestOSTypes.begin();
     
    14111411        if (typeId.compareIgnoreCase (id) == 0)
    14121412        {
    1413             (*it).queryInterfaceTo (aType);
     1413            (*it).queryInterfaceTo(aType);
    14141414            break;
    14151415        }
     
    14281428    CheckComArgNotNull(aHostPath);
    14291429
    1430     AutoCaller autoCaller (this);
    1431     CheckComRCReturnRC (autoCaller.rc());
     1430    AutoCaller autoCaller(this);
     1431    CheckComRCReturnRC(autoCaller.rc());
    14321432
    14331433    return setError (E_NOTIMPL, "Not yet implemented");
     
    14381438    CheckComArgNotNull(aName);
    14391439
    1440     AutoCaller autoCaller (this);
    1441     CheckComRCReturnRC (autoCaller.rc());
     1440    AutoCaller autoCaller(this);
     1441    CheckComRCReturnRC(autoCaller.rc());
    14421442
    14431443    return setError (E_NOTIMPL, "Not yet implemented");
     
    14521452    CheckComArgNotNull(aNextKey);
    14531453
    1454     AutoCaller autoCaller (this);
    1455     CheckComRCReturnRC (autoCaller.rc());
     1454    AutoCaller autoCaller(this);
     1455    CheckComRCReturnRC(autoCaller.rc());
    14561456
    14571457    /* start with nothing found */
     
    14651465
    14661466    /* serialize file access (prevent writes) */
    1467     AutoReadLock alock (this);
     1467    AutoReadLock alock(this);
    14681468
    14691469    try
     
    14781478
    14791479        rc = VirtualBox::loadSettingsTree_Again (tree, file);
    1480         CheckComRCReturnRC (rc);
     1480        CheckComRCReturnRC(rc);
    14811481
    14821482        Key globalNode = tree.rootKey().key ("Global");
     
    14961496                    if (bstrInKey.isEmpty())
    14971497                    {
    1498                         key.cloneTo (aNextKey);
     1498                        key.cloneTo(aNextKey);
    14991499                        if (aNextValue)
    15001500                        {
    15011501                            Bstr val = (*it).stringValue ("value");
    1502                             val.cloneTo (aNextValue);
     1502                            val.cloneTo(aNextValue);
    15031503                        }
    15041504                        return S_OK;
     
    15131513                        {
    15141514                            Bstr key = (*it).stringValue ("name");
    1515                             key.cloneTo (aNextKey);
     1515                            key.cloneTo(aNextKey);
    15161516                            if (aNextValue)
    15171517                            {
    15181518                                Bstr val = (*it).stringValue ("value");
    1519                                 val.cloneTo (aNextValue);
     1519                                val.cloneTo(aNextValue);
    15201520                            }
    15211521                        }
     
    15531553    CheckComArgNotNull(aValue);
    15541554
    1555     AutoCaller autoCaller (this);
    1556     CheckComRCReturnRC (autoCaller.rc());
     1555    AutoCaller autoCaller(this);
     1556    CheckComRCReturnRC(autoCaller.rc());
    15571557
    15581558    /* start with nothing found */
     
    15621562
    15631563    /* serialize file access (prevent writes) */
    1564     AutoReadLock alock (this);
     1564    AutoReadLock alock(this);
    15651565
    15661566    try
     
    15751575
    15761576        rc = VirtualBox::loadSettingsTree_Again (tree, file);
    1577         CheckComRCReturnRC (rc);
     1577        CheckComRCReturnRC(rc);
    15781578
    15791579        const Utf8Str key = aKey;
     
    15921592                {
    15931593                    Bstr val = (*it).stringValue ("value");
    1594                     val.cloneTo (aValue);
     1594                    val.cloneTo(aValue);
    15951595                    break;
    15961596                }
     
    16131613    CheckComArgNotNull(aKey);
    16141614
    1615     AutoCaller autoCaller (this);
    1616     CheckComRCReturnRC (autoCaller.rc());
     1615    AutoCaller autoCaller(this);
     1616    CheckComRCReturnRC(autoCaller.rc());
    16171617
    16181618    Guid emptyGuid;
     
    16271627
    16281628    /* serialize file access (prevent concurrent reads and writes) */
    1629     AutoWriteLock alock (this);
     1629    AutoWriteLock alock(this);
    16301630
    16311631    try
     
    16391639
    16401640        rc = VirtualBox::loadSettingsTree_ForUpdate (tree, file);
    1641         CheckComRCReturnRC (rc);
     1641        CheckComRCReturnRC(rc);
    16421642
    16431643        const Utf8Str key = aKey;
     
    17001700            rc = VirtualBox::saveSettingsTree (tree, file,
    17011701                                               mData.mSettingsFileVersion);
    1702             CheckComRCReturnRC (rc);
     1702            CheckComRCReturnRC(rc);
    17031703        }
    17041704    }
     
    17091709
    17101710    /* fire a notification */
    1711     if (SUCCEEDED (rc) && changed)
     1711    if (SUCCEEDED(rc) && changed)
    17121712        onExtraDataChange (Guid::Empty, aKey, aValue);
    17131713
     
    17221722    CheckComArgNotNull(aSession);
    17231723
    1724     AutoCaller autoCaller (this);
    1725     CheckComRCReturnRC (autoCaller.rc());
     1724    AutoCaller autoCaller(this);
     1725    CheckComRCReturnRC(autoCaller.rc());
    17261726
    17271727    Guid id(aMachineId);
    1728     ComObjPtr <Machine> machine;
     1728    ComObjPtr<Machine> machine;
    17291729
    17301730    HRESULT rc = findMachine (id, true /* setError */, &machine);
    1731     CheckComRCReturnRC (rc);
     1731    CheckComRCReturnRC(rc);
    17321732
    17331733    /* check the session state */
    17341734    SessionState_T state;
    17351735    rc = aSession->COMGETTER(State) (&state);
    1736     CheckComRCReturnRC (rc);
     1736    CheckComRCReturnRC(rc);
    17371737
    17381738    if (state != SessionState_Closed)
     
    17411741
    17421742    /* get the IInternalSessionControl interface */
    1743     ComPtr <IInternalSessionControl> control = aSession;
     1743    ComPtr<IInternalSessionControl> control = aSession;
    17441744    ComAssertMsgRet (!!control, ("No IInternalSessionControl interface"),
    17451745                     E_INVALIDARG);
     
    17471747    rc = machine->openSession (control);
    17481748
    1749     if (SUCCEEDED (rc))
     1749    if (SUCCEEDED(rc))
    17501750    {
    17511751        /*
     
    17781778    CheckComArgOutSafeArrayPointerValid(aProgress);
    17791779
    1780     AutoCaller autoCaller (this);
    1781     CheckComRCReturnRC (autoCaller.rc());
     1780    AutoCaller autoCaller(this);
     1781    CheckComRCReturnRC(autoCaller.rc());
    17821782
    17831783    Guid id(aMachineId);
    1784     ComObjPtr <Machine> machine;
     1784    ComObjPtr<Machine> machine;
    17851785
    17861786    HRESULT rc = findMachine (id, true /* setError */, &machine);
    1787     CheckComRCReturnRC (rc);
     1787    CheckComRCReturnRC(rc);
    17881788
    17891789    /* check the session state */
    17901790    SessionState_T state;
    17911791    rc = aSession->COMGETTER(State) (&state);
    1792     CheckComRCReturnRC (rc);
     1792    CheckComRCReturnRC(rc);
    17931793
    17941794    if (state != SessionState_Closed)
     
    17971797
    17981798    /* get the IInternalSessionControl interface */
    1799     ComPtr <IInternalSessionControl> control = aSession;
     1799    ComPtr<IInternalSessionControl> control = aSession;
    18001800    ComAssertMsgRet (!!control, ("No IInternalSessionControl interface"),
    18011801                     E_INVALIDARG);
    18021802
    18031803    /* create a progress object */
    1804     ComObjPtr <Progress> progress;
     1804    ComObjPtr<Progress> progress;
    18051805    progress.createObject();
    18061806    progress->init (this, static_cast <IMachine *> (machine),
     
    18101810    rc = machine->openRemoteSession (control, aType, aEnvironment, progress);
    18111811
    1812     if (SUCCEEDED (rc))
    1813     {
    1814         progress.queryInterfaceTo (aProgress);
     1812    if (SUCCEEDED(rc))
     1813    {
     1814        progress.queryInterfaceTo(aProgress);
    18151815
    18161816        /* signal the client watcher thread */
     
    18321832    CheckComArgNotNull(aSession);
    18331833
    1834     AutoCaller autoCaller (this);
    1835     CheckComRCReturnRC (autoCaller.rc());
     1834    AutoCaller autoCaller(this);
     1835    CheckComRCReturnRC(autoCaller.rc());
    18361836
    18371837    Guid id(aMachineId);
    1838     ComObjPtr <Machine> machine;
     1838    ComObjPtr<Machine> machine;
    18391839
    18401840    HRESULT rc = findMachine (id, true /* setError */, &machine);
    1841     CheckComRCReturnRC (rc);
     1841    CheckComRCReturnRC(rc);
    18421842
    18431843    /* check the session state */
    18441844    SessionState_T state;
    18451845    rc = aSession->COMGETTER(State) (&state);
    1846     CheckComRCReturnRC (rc);
     1846    CheckComRCReturnRC(rc);
    18471847
    18481848    if (state != SessionState_Closed)
     
    18511851
    18521852    /* get the IInternalSessionControl interface */
    1853     ComPtr <IInternalSessionControl> control = aSession;
     1853    ComPtr<IInternalSessionControl> control = aSession;
    18541854    ComAssertMsgRet (!!control, ("No IInternalSessionControl interface"),
    18551855                     E_INVALIDARG);
     
    18651865STDMETHODIMP VirtualBox::RegisterCallback (IVirtualBoxCallback *aCallback)
    18661866{
    1867     LogFlowThisFunc (("aCallback=%p\n", aCallback));
     1867    LogFlowThisFunc(("aCallback=%p\n", aCallback));
    18681868
    18691869    CheckComArgNotNull(aCallback);
    18701870
    1871     AutoCaller autoCaller (this);
    1872     CheckComRCReturnRC (autoCaller.rc());
     1871    AutoCaller autoCaller(this);
     1872    CheckComRCReturnRC(autoCaller.rc());
    18731873
    18741874#if 0 /** @todo r=bird,r=pritesh: must check that the interface id match correct or we might screw up with old code! */
     
    18801880#endif
    18811881
    1882     AutoWriteLock alock (this);
     1882    AutoWriteLock alock(this);
    18831883    mData.mCallbacks.push_back (CallbackList::value_type (aCallback));
    18841884
     
    18931893    CheckComArgNotNull(aCallback);
    18941894
    1895     AutoCaller autoCaller (this);
    1896     CheckComRCReturnRC (autoCaller.rc());
     1895    AutoCaller autoCaller(this);
     1896    CheckComRCReturnRC(autoCaller.rc());
    18971897
    18981898    HRESULT rc = S_OK;
    18991899
    1900     AutoWriteLock alock (this);
     1900    AutoWriteLock alock(this);
    19011901
    19021902    CallbackList::iterator it;
     
    19091909        mData.mCallbacks.erase (it);
    19101910
    1911     LogFlowThisFunc (("aCallback=%p, rc=%08X\n", aCallback, rc));
     1911    LogFlowThisFunc(("aCallback=%p, rc=%08X\n", aCallback, rc));
    19121912    return rc;
    19131913}
     
    19221922STDMETHODIMP VirtualBox::SaveSettings()
    19231923{
    1924     AutoCaller autoCaller (this);
    1925     CheckComRCReturnRC (autoCaller.rc());
     1924    AutoCaller autoCaller(this);
     1925    CheckComRCReturnRC(autoCaller.rc());
    19261926
    19271927    return saveSettings();
     
    19321932    CheckComArgNotNull(aBakFileName);
    19331933
    1934     AutoCaller autoCaller (this);
    1935     CheckComRCReturnRC (autoCaller.rc());
     1934    AutoCaller autoCaller(this);
     1935    CheckComRCReturnRC(autoCaller.rc());
    19361936
    19371937    /* saveSettings() needs write lock */
    1938     AutoWriteLock alock (this);
     1938    AutoWriteLock alock(this);
    19391939
    19401940    /* perform backup only when there was auto-conversion */
     
    19461946                                         mData.mSettingsFileVersion,
    19471947                                         bakFileName);
    1948         CheckComRCReturnRC (rc);
    1949 
    1950         bakFileName.cloneTo (aBakFileName);
     1948        CheckComRCReturnRC(rc);
     1949
     1950        bakFileName.cloneTo(aBakFileName);
    19511951    }
    19521952
     
    19741974HRESULT VirtualBox::postEvent (Event *event)
    19751975{
    1976     AutoCaller autoCaller (this);
     1976    AutoCaller autoCaller(this);
    19771977    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    19781978
     
    19851985    }
    19861986
    1987     AssertReturn (event, E_FAIL);
    1988     AssertReturn (mAsyncEventQ, E_FAIL);
     1987    AssertReturn(event, E_FAIL);
     1988    AssertReturn(mAsyncEventQ, E_FAIL);
    19891989
    19901990    if (mAsyncEventQ->postEvent (event))
     
    20062006    CheckComArgNotNull(aProgress);
    20072007
    2008     AutoCaller autoCaller (this);
    2009     CheckComRCReturnRC (autoCaller.rc());
     2008    AutoCaller autoCaller(this);
     2009    CheckComRCReturnRC(autoCaller.rc());
    20102010
    20112011    Bstr id;
    20122012    HRESULT rc = aProgress->COMGETTER(Id) (id.asOutParam());
    2013     AssertComRCReturnRC (rc);
     2013    AssertComRCReturnRC(rc);
    20142014
    20152015    /* protect mProgressOperations */
     
    20302030HRESULT VirtualBox::removeProgress (IN_GUID aId)
    20312031{
    2032     AutoCaller autoCaller (this);
    2033     CheckComRCReturnRC (autoCaller.rc());
    2034 
    2035     ComPtr <IProgress> progress;
     2032    AutoCaller autoCaller(this);
     2033    CheckComRCReturnRC(autoCaller.rc());
     2034
     2035    ComPtr<IProgress> progress;
    20362036
    20372037    /* protect mProgressOperations */
     
    20492049struct StartSVCHelperClientData
    20502050{
    2051     ComObjPtr <VirtualBox> that;
    2052     ComObjPtr <Progress> progress;
     2051    ComObjPtr<VirtualBox> that;
     2052    ComObjPtr<Progress> progress;
    20532053    bool privileged;
    20542054    VirtualBox::SVCHelperClientFunc func;
     
    21082108                                          void *aUser, Progress *aProgress)
    21092109{
    2110     AssertReturn (aFunc, E_POINTER);
    2111     AssertReturn (aProgress, E_POINTER);
    2112 
    2113     AutoCaller autoCaller (this);
    2114     CheckComRCReturnRC (autoCaller.rc());
     2110    AssertReturn(aFunc, E_POINTER);
     2111    AssertReturn(aProgress, E_POINTER);
     2112
     2113    AutoCaller autoCaller(this);
     2114    CheckComRCReturnRC(autoCaller.rc());
    21152115
    21162116    /* create the SVCHelperClientThread() argument */
    21172117    std::auto_ptr <StartSVCHelperClientData>
    21182118        d (new StartSVCHelperClientData());
    2119     AssertReturn (d.get(), E_OUTOFMEMORY);
     2119    AssertReturn(d.get(), E_OUTOFMEMORY);
    21202120
    21212121    d->that = this;
     
    21582158    {
    21592159        AssertBreakStmt (d.get(), rc = E_POINTER);
    2160         AssertReturn (!d->progress.isNull(), E_POINTER);
     2160        AssertReturn(!d->progress.isNull(), E_POINTER);
    21612161
    21622162        /* protect VirtualBox from uninitialization */
    2163         AutoCaller autoCaller (d->that);
     2163        AutoCaller autoCaller(d->that);
    21642164        if (!autoCaller.isOk())
    21652165        {
     
    21762176        vrc = client.create (Utf8StrFmt ("VirtualBox\\SVCHelper\\{%RTuuid}",
    21772177                                         id.raw()));
    2178         if (RT_FAILURE (vrc))
     2178        if (RT_FAILURE(vrc))
    21792179        {
    21802180            rc = setError (E_FAIL,
     
    22332233            const char *args[] = { exePath, "/Helper", client.name(), 0 };
    22342234            vrc = RTProcCreate (exePath, args, RTENV_DEFAULT, 0, &pid);
    2235             if (RT_FAILURE (vrc))
     2235            if (RT_FAILURE(vrc))
    22362236            {
    22372237                rc = setError (E_FAIL,
     
    22432243        /* wait for the client to connect */
    22442244        vrc = client.connect();
    2245         if (RT_SUCCESS (vrc))
     2245        if (RT_SUCCESS(vrc))
    22462246        {
    22472247            /* start the user supplied function */
     
    22532253        {
    22542254            int vrc2 = client.write (SVCHlpMsg::Null);
    2255             if (RT_SUCCESS (vrc))
     2255            if (RT_SUCCESS(vrc))
    22562256                vrc = vrc2;
    22572257        }
    22582258
    2259         if (SUCCEEDED (rc) && RT_FAILURE (vrc))
     2259        if (SUCCEEDED(rc) && RT_FAILURE(vrc))
    22602260        {
    22612261            rc = setError (E_FAIL,
     
    22892289void VirtualBox::updateClientWatcher()
    22902290{
    2291     AutoCaller autoCaller (this);
     2291    AutoCaller autoCaller(this);
    22922292    AssertComRCReturn (autoCaller.rc(), (void) 0);
    22932293
    2294     AssertReturn (mWatcherData.mThread != NIL_RTTHREAD, (void) 0);
     2294    AssertReturn(mWatcherData.mThread != NIL_RTTHREAD, (void) 0);
    22952295
    22962296    /* sent an update request */
     
    23122312void VirtualBox::addProcessToReap (RTPROCESS pid)
    23132313{
    2314     AutoCaller autoCaller (this);
     2314    AutoCaller autoCaller(this);
    23152315    AssertComRCReturn (autoCaller.rc(), (void) 0);
    23162316
    23172317    /// @todo (dmik) Win32?
    23182318#ifndef RT_OS_WINDOWS
    2319     AutoWriteLock alock (this);
     2319    AutoWriteLock alock(this);
    23202320    mWatcherData.mProcesses.push_back (pid);
    23212321#endif
     
    23412341        {}
    23422342
    2343     void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback)
     2343    void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback)
    23442344    {
    23452345        switch (what)
     
    23742374 *  @note Doesn't lock any object.
    23752375 */
    2376 void VirtualBox::onMachineStateChange (const Guid &aId, MachineState_T aState)
     2376void VirtualBox::onMachineStateChange(const Guid &aId, MachineState_T aState)
    23772377{
    23782378    postEvent (new MachineEvent (this, aId, aState));
     
    23822382 *  @note Doesn't lock any object.
    23832383 */
    2384 void VirtualBox::onMachineDataChange (const Guid &aId)
     2384void VirtualBox::onMachineDataChange(const Guid &aId)
    23852385{
    23862386    postEvent (new MachineEvent (this, aId));
     
    23932393                                       Bstr &aError)
    23942394{
    2395     LogFlowThisFunc (("machine={%s} aKey={%ls} aValue={%ls}\n",
     2395    LogFlowThisFunc(("machine={%s} aKey={%ls} aValue={%ls}\n",
    23962396                      aId.toString().raw(), aKey, aValue));
    23972397
    2398     AutoCaller autoCaller (this);
     2398    AutoCaller autoCaller(this);
    23992399    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    24002400
    24012401    CallbackList list;
    24022402    {
    2403         AutoReadLock alock (this);
     2403        AutoReadLock alock(this);
    24042404        list = mData.mCallbacks;
    24052405    }
     
    24232423    }
    24242424
    2425     LogFlowThisFunc (("allowChange=%RTbool\n", allowChange));
     2425    LogFlowThisFunc(("allowChange=%RTbool\n", allowChange));
    24262426    return allowChange;
    24272427}
     
    24362436        {}
    24372437
    2438     void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback)
     2438    void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback)
    24392439    {
    24402440        LogFlow (("OnExtraDataChange: machineId={%RTuuid}, key='%ls', val='%ls'\n",
     
    24702470        {}
    24712471
    2472     void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback)
     2472    void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback)
    24732473    {
    24742474        LogFlow (("OnSessionStateChange: machineId={%RTuuid}, sessionState=%d\n",
     
    25012501        {}
    25022502
    2503     void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback)
     2503    void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback)
    25042504    {
    25052505        Bstr mid = machineId.toUtf16();
     
    25672567        {}
    25682568
    2569     void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback)
     2569    void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback)
    25702570    {
    25712571        LogFlow (("OnGuestPropertyChange: machineId={%RTuuid}, name='%ls', value='%ls', flags='%ls'\n",
     
    25902590 *  @note Locks this object for reading.
    25912591 */
    2592 ComObjPtr <GuestOSType> VirtualBox::getUnknownOSType()
    2593 {
    2594     ComObjPtr <GuestOSType> type;
    2595 
    2596     AutoCaller autoCaller (this);
     2592ComObjPtr<GuestOSType> VirtualBox::getUnknownOSType()
     2593{
     2594    ComObjPtr<GuestOSType> type;
     2595
     2596    AutoCaller autoCaller(this);
    25972597    AssertComRCReturn (autoCaller.rc(), type);
    25982598
    2599     AutoReadLock alock (this);
     2599    AutoReadLock alock(this);
    26002600
    26012601    /* unknown type must always be the first */
     
    26252625                                    InternalControlVector *aControls /*= NULL*/)
    26262626{
    2627     AutoCaller autoCaller (this);
     2627    AutoCaller autoCaller(this);
    26282628    AssertComRCReturnVoid (autoCaller.rc());
    26292629
     
    26322632        aControls->clear();
    26332633
    2634     AutoReadLock alock (this);
     2634    AutoReadLock alock(this);
    26352635
    26362636    for (MachineList::iterator it = mData.mMachines.begin();
     
    26382638         ++ it)
    26392639    {
    2640         ComObjPtr <SessionMachine> sm;
    2641         ComPtr <IInternalSessionControl> ctl;
     2640        ComObjPtr<SessionMachine> sm;
     2641        ComPtr<IInternalSessionControl> ctl;
    26422642        if ((*it)->isSessionOpen (sm, &ctl))
    26432643        {
     
    26672667 */
    26682668HRESULT VirtualBox::findMachine (const Guid &aId, bool aSetError,
    2669                                  ComObjPtr <Machine> *aMachine /* = NULL */)
    2670 {
    2671     AutoCaller autoCaller (this);
     2669                                 ComObjPtr<Machine> *aMachine /* = NULL */)
     2670{
     2671    AutoCaller autoCaller(this);
    26722672    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    26732673
     
    26752675
    26762676    {
    2677         AutoReadLock alock (this);
     2677        AutoReadLock alock(this);
    26782678
    26792679        for (MachineList::iterator it = mData.mMachines.begin();
     
    27222722             bool aSetError, ComObjPtr<HardDisk> *aHardDisk /*= NULL*/)
    27232723{
    2724     AssertReturn (aId || aLocation, E_INVALIDARG);
    2725 
    2726     AutoReadLock alock (this);
     2724    AssertReturn(aId || aLocation, E_INVALIDARG);
     2725
     2726    AutoReadLock alock(this);
    27272727
    27282728    /* first, look up by UUID in the map if UUID is provided */
     
    27512751
    27522752            HRESULT rc = hd->compareLocationTo (location, result);
    2753             CheckComRCReturnRC (rc);
     2753            CheckComRCReturnRC(rc);
    27542754
    27552755            if (result == 0)
     
    27982798                                 ComObjPtr<DVDImage> *aImage /* = NULL */)
    27992799{
    2800     AssertReturn (aId || aLocation, E_INVALIDARG);
     2800    AssertReturn(aId || aLocation, E_INVALIDARG);
    28012801
    28022802    Utf8Str location;
     
    28052805    {
    28062806        int vrc = calculateFullPath (Utf8Str (aLocation), location);
    2807         if (RT_FAILURE (vrc))
     2807        if (RT_FAILURE(vrc))
    28082808            return setError (VBOX_E_FILE_ERROR,
    28092809                tr ("Invalid image file location '%ls' (%Rrc)"),
     
    28112811    }
    28122812
    2813     AutoReadLock alock (this);
     2813    AutoReadLock alock(this);
    28142814
    28152815    bool found = false;
     
    28702870                                    ComObjPtr<FloppyImage> *aImage /* = NULL */)
    28712871{
    2872     AssertReturn (aId || aLocation, E_INVALIDARG);
     2872    AssertReturn(aId || aLocation, E_INVALIDARG);
    28732873
    28742874    Utf8Str location;
     
    28772877    {
    28782878        int vrc = calculateFullPath (Utf8Str (aLocation), location);
    2879         if (RT_FAILURE (vrc))
     2879        if (RT_FAILURE(vrc))
    28802880            return setError (VBOX_E_FILE_ERROR,
    28812881                tr ("Invalid image file location '%ls' (%Rrc)"),
     
    28832883    }
    28842884
    2885     AutoReadLock alock (this);
     2885    AutoReadLock alock(this);
    28862886
    28872887    bool found = false;
     
    29352935int VirtualBox::calculateFullPath (const char *aPath, Utf8Str &aResult)
    29362936{
    2937     AutoCaller autoCaller (this);
     2937    AutoCaller autoCaller(this);
    29382938    AssertComRCReturn (autoCaller.rc(), VERR_GENERAL_FAILURE);
    29392939
     
    29422942    char folder [RTPATH_MAX];
    29432943    int vrc = RTPathAbsEx (mData.mHomeDir, aPath, folder, sizeof (folder));
    2944     if (RT_SUCCESS (vrc))
     2944    if (RT_SUCCESS(vrc))
    29452945        aResult = folder;
    29462946
     
    29612961void VirtualBox::calculateRelativePath (const char *aPath, Utf8Str &aResult)
    29622962{
    2963     AutoCaller autoCaller (this);
     2963    AutoCaller autoCaller(this);
    29642964    AssertComRCReturnVoid (autoCaller.rc());
    29652965
     
    30023002    aConflict.setNull();
    30033003
    3004     AssertReturn (!aId.isEmpty() && !aLocation.isEmpty(), E_FAIL);
    3005 
    3006     AutoReadLock alock (this);
     3004    AssertReturn(!aId.isEmpty() && !aLocation.isEmpty(), E_FAIL);
     3005
     3006    AutoReadLock alock(this);
    30073007
    30083008    HRESULT rc = S_OK;
     
    30113011        ComObjPtr<HardDisk> hardDisk;
    30123012        rc = findHardDisk(&aId, aLocation, false /* aSetError */, &hardDisk);
    3013         if (SUCCEEDED (rc))
     3013        if (SUCCEEDED(rc))
    30143014        {
    30153015            /* Note: no AutoCaller since bound to this */
     
    30253025        ComObjPtr<DVDImage> image;
    30263026        rc = findDVDImage (&aId, aLocation, false /* aSetError */, &image);
    3027         if (SUCCEEDED (rc))
     3027        if (SUCCEEDED(rc))
    30283028        {
    30293029            /* Note: no AutoCaller since bound to this */
     
    30393039        ComObjPtr<FloppyImage> image;
    30403040        rc = findFloppyImage(&aId, aLocation, false /* aSetError */, &image);
    3041         if (SUCCEEDED (rc))
     3041        if (SUCCEEDED(rc))
    30423042        {
    30433043            /* Note: no AutoCaller since bound to this */
     
    30663066    using namespace settings;
    30673067
    3068     AutoCaller autoCaller (this);
    3069     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     3068    AutoCaller autoCaller(this);
     3069    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    30703070
    30713071    HRESULT rc = S_OK;
     
    30813081
    30823082        /* create a new machine object */
    3083         ComObjPtr <Machine> machine;
     3083        ComObjPtr<Machine> machine;
    30843084        rc = machine.createObject();
    3085         if (SUCCEEDED (rc))
     3085        if (SUCCEEDED(rc))
    30863086        {
    30873087            /* initialize the machine object and register it */
    30883088            rc = machine->init (this, src, Machine::Init_Registered,
    30893089                                NULL, NULL, FALSE, &uuid);
    3090             if (SUCCEEDED (rc))
     3090            if (SUCCEEDED(rc))
    30913091                rc = registerMachine (machine);
    30923092        }
     
    31093109    using namespace settings;
    31103110
    3111     AutoCaller autoCaller (this);
    3112     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     3111    AutoCaller autoCaller(this);
     3112    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    31133113
    31143114    HRESULT rc = S_OK;
     
    32013201    using namespace settings;
    32023202
    3203     AutoCaller autoCaller (this);
    3204     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     3203    AutoCaller autoCaller(this);
     3204    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    32053205
    32063206    HRESULT rc = S_OK;
     
    32473247HRESULT VirtualBox::saveSettings()
    32483248{
    3249     AutoCaller autoCaller (this);
     3249    AutoCaller autoCaller(this);
    32503250    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    32513251
    3252     AssertReturn (!!mData.mCfgFile.mName, E_FAIL);
     3252    AssertReturn(!!mData.mCfgFile.mName, E_FAIL);
    32533253
    32543254    HRESULT rc = S_OK;
    32553255
    32563256    /* serialize file access (prevents concurrent reads and writes) */
    3257     AutoWriteLock alock (this);
     3257    AutoWriteLock alock(this);
    32583258
    32593259    try
     
    34113411    ComAssertRet (aMachine, E_INVALIDARG);
    34123412
    3413     AutoCaller autoCaller (this);
    3414     CheckComRCReturnRC (autoCaller.rc());
    3415 
    3416     AutoWriteLock alock (this);
     3413    AutoCaller autoCaller(this);
     3414    CheckComRCReturnRC(autoCaller.rc());
     3415
     3416    AutoWriteLock alock(this);
    34173417
    34183418    HRESULT rc = S_OK;
    34193419
    34203420    {
    3421         ComObjPtr <Machine> m;
     3421        ComObjPtr<Machine> m;
    34223422        rc = findMachine (aMachine->id(), false /* aDoSetError */, &m);
    3423         if (SUCCEEDED (rc))
     3423        if (SUCCEEDED(rc))
    34243424        {
    34253425            /* sanity */
     
    34403440        /* Machine::trySetRegistered() will commit and save machine settings */
    34413441        rc = aMachine->trySetRegistered (TRUE);
    3442         CheckComRCReturnRC (rc);
     3442        CheckComRCReturnRC(rc);
    34433443    }
    34443444
     
    34703470                                     bool aSaveRegistry /*= true*/)
    34713471{
    3472     AssertReturn (aHardDisk != NULL, E_INVALIDARG);
    3473 
    3474     AutoCaller autoCaller (this);
     3472    AssertReturn(aHardDisk != NULL, E_INVALIDARG);
     3473
     3474    AutoCaller autoCaller(this);
    34753475    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    34763476
    3477     AutoWriteLock alock (this);
     3477    AutoWriteLock alock(this);
    34783478
    34793479    AutoCaller hardDiskCaller (aHardDisk);
     
    34863486                                         aHardDisk->locationFull(),
    34873487                                         strConflict);
    3488     CheckComRCReturnRC (rc);
     3488    CheckComRCReturnRC(rc);
    34893489
    34903490    if (strConflict.length())
     
    35363536                                       bool aSaveRegistry /*= true*/)
    35373537{
    3538     AssertReturn (aHardDisk != NULL, E_INVALIDARG);
    3539 
    3540     AutoCaller autoCaller (this);
     3538    AssertReturn(aHardDisk != NULL, E_INVALIDARG);
     3539
     3540    AutoCaller autoCaller(this);
    35413541    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    35423542
    3543     AutoWriteLock alock (this);
     3543    AutoWriteLock alock(this);
    35443544
    35453545    AutoCaller hardDiskCaller (aHardDisk);
     
    35883588                                      bool aSaveRegistry /*= true*/)
    35893589{
    3590     AssertReturn (aImage != NULL, E_INVALIDARG);
    3591 
    3592     AutoCaller autoCaller (this);
     3590    AssertReturn(aImage != NULL, E_INVALIDARG);
     3591
     3592    AutoCaller autoCaller(this);
    35933593    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    35943594
    3595     AutoWriteLock alock (this);
     3595    AutoWriteLock alock(this);
    35963596
    35973597    AutoCaller imageCaller (aImage);
     
    36043604                                         aImage->locationFull(),
    36053605                                         strConflict);
    3606     CheckComRCReturnRC (rc);
     3606    CheckComRCReturnRC(rc);
    36073607
    36083608    if (strConflict.length())
     
    36473647                                        bool aSaveRegistry /*= true*/)
    36483648{
    3649     AssertReturn (aImage != NULL, E_INVALIDARG);
    3650 
    3651     AutoCaller autoCaller (this);
     3649    AssertReturn(aImage != NULL, E_INVALIDARG);
     3650
     3651    AutoCaller autoCaller(this);
    36523652    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    36533653
    3654     AutoWriteLock alock (this);
     3654    AutoWriteLock alock(this);
    36553655
    36563656    AutoCaller imageCaller (aImage);
     
    36913691                                        bool aSaveRegistry /*= true*/)
    36923692{
    3693     AssertReturn (aImage != NULL, E_INVALIDARG);
    3694 
    3695     AutoCaller autoCaller (this);
     3693    AssertReturn(aImage != NULL, E_INVALIDARG);
     3694
     3695    AutoCaller autoCaller(this);
    36963696    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    36973697
    3698     AutoWriteLock alock (this);
     3698    AutoWriteLock alock(this);
    36993699
    37003700    AutoCaller imageCaller (aImage);
     
    37073707                                         aImage->locationFull(),
    37083708                                         strConflict);
    3709     CheckComRCReturnRC (rc);
     3709    CheckComRCReturnRC(rc);
    37103710
    37113711    if (strConflict.length())
     
    37503750                                          bool aSaveRegistry /*= true*/)
    37513751{
    3752     AssertReturn (aImage != NULL, E_INVALIDARG);
    3753 
    3754     AutoCaller autoCaller (this);
     3752    AssertReturn(aImage != NULL, E_INVALIDARG);
     3753
     3754    AutoCaller autoCaller(this);
    37553755    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    37563756
    3757     AutoWriteLock alock (this);
     3757    AutoWriteLock alock(this);
    37583758
    37593759    AutoCaller imageCaller (aImage);
     
    37863786 * @note Locks #childrenLock() for reading.
    37873787 */
    3788 HRESULT VirtualBox::cast (IHardDisk *aFrom, ComObjPtr <HardDisk> &aTo)
    3789 {
    3790     AssertReturn (aFrom != NULL, E_INVALIDARG);
    3791 
    3792     AutoCaller autoCaller (this);
     3788HRESULT VirtualBox::cast (IHardDisk *aFrom, ComObjPtr<HardDisk> &aTo)
     3789{
     3790    AssertReturn(aFrom != NULL, E_INVALIDARG);
     3791
     3792    AutoCaller autoCaller(this);
    37933793    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    37943794
     
    38223822HRESULT VirtualBox::updateSettings (const char *aOldPath, const char *aNewPath)
    38233823{
    3824     LogFlowThisFunc (("aOldPath={%s} aNewPath={%s}\n", aOldPath, aNewPath));
    3825 
    3826     AssertReturn (aOldPath, E_INVALIDARG);
    3827     AssertReturn (aNewPath, E_INVALIDARG);
    3828 
    3829     AutoCaller autoCaller (this);
     3824    LogFlowThisFunc(("aOldPath={%s} aNewPath={%s}\n", aOldPath, aNewPath));
     3825
     3826    AssertReturn(aOldPath, E_INVALIDARG);
     3827    AssertReturn(aNewPath, E_INVALIDARG);
     3828
     3829    AutoCaller autoCaller(this);
    38303830    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    38313831
    3832     AutoWriteLock alock (this);
     3832    AutoWriteLock alock(this);
    38333833
    38343834    /* check DVD paths */
     
    38813881    {
    38823882        int vrc = RTDirCreateFullPath(strDir, 0777);
    3883         if (RT_FAILURE (vrc))
     3883        if (RT_FAILURE(vrc))
    38843884        {
    38853885            return setError (E_FAIL,
     
    40354035    {
    40364036        Utf8Str tmp = nf;
    4037         for (int i = 0; i <= 9 && RT_FAILURE (vrc); ++ i)
     4037        for (int i = 0; i <= 9 && RT_FAILURE(vrc); ++ i)
    40384038        {
    40394039            nf = Utf8StrFmt ("%s.%d", tmp.raw(), i);
     
    40434043    }
    40444044
    4045     if (RT_FAILURE (vrc))
     4045    if (RT_FAILURE(vrc))
    40464046        return setError (VBOX_E_IPRT_ERROR,
    40474047            tr ("Could not copy the settings file '%s' to '%s' (%Rrc)"),
     
    41154115HRESULT VirtualBox::lockConfig()
    41164116{
    4117     AutoCaller autoCaller (this);
     4117    AutoCaller autoCaller(this);
    41184118    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    4119     AssertReturn (autoCaller.state() == InInit, E_FAIL);
     4119    AssertReturn(autoCaller.state() == InInit, E_FAIL);
    41204120
    41214121    HRESULT rc = S_OK;
     
    41294129                              RTFILE_O_READWRITE | RTFILE_O_OPEN |
    41304130                              RTFILE_O_DENY_WRITE);
    4131         if (RT_FAILURE (vrc) && (vrc != VERR_FILE_NOT_FOUND))
     4131        if (RT_FAILURE(vrc) && (vrc != VERR_FILE_NOT_FOUND))
    41324132        {
    41334133            /* Open the associated config file only with read access. */
     
    41364136                              RTFILE_O_READ | RTFILE_O_OPEN |
    41374137                              RTFILE_O_DENY_NONE);
    4138             if (RT_FAILURE (vrc))
     4138            if (RT_FAILURE(vrc))
    41394139            {
    41404140                /* We even cannot open it in read mode, so there's seriously
     
    41604160        }
    41614161
    4162         LogFlowThisFunc (("mCfgFile.mName='%ls', mCfgFile.mHandle=%d, rc=%08X\n",
     4162        LogFlowThisFunc(("mCfgFile.mName='%ls', mCfgFile.mHandle=%d, rc=%08X\n",
    41634163                          mData.mCfgFile.mName.raw(), mData.mCfgFile.mHandle, rc));
    41644164    }
     
    41744174HRESULT VirtualBox::unlockConfig()
    41754175{
    4176     AutoCaller autoCaller (this);
     4176    AutoCaller autoCaller(this);
    41774177    AssertComRCReturn (autoCaller.rc(), E_FAIL);
    4178     AssertReturn (autoCaller.state() == InUninit, E_FAIL);
     4178    AssertReturn(autoCaller.state() == InUninit, E_FAIL);
    41794179
    41804180    HRESULT rc = S_OK;
     
    41874187        mData.mCfgFile.mHandle = NIL_RTFILE;
    41884188        mData.mCfgFile.mReadonly = FALSE;
    4189         LogFlowThisFunc (("\n"));
     4189        LogFlowThisFunc(("\n"));
    41904190    }
    41914191
     
    42254225    do
    42264226    {
    4227         AutoCaller autoCaller (that);
     4227        AutoCaller autoCaller(that);
    42284228        /* VirtualBox has been early uninitialized, terminate */
    42294229        if (!autoCaller.isOk())
     
    42904290                                    ("MAXIMUM_WAIT_OBJECTS reached"));
    42914291
    4292                     ComObjPtr <SessionMachine> sm;
     4292                    ComObjPtr<SessionMachine> sm;
    42934293                    HANDLE ipcSem;
    42944294                    if ((*it)->isSessionOpenOrClosing (sm, NULL, &ipcSem))
     
    43564356    do
    43574357    {
    4358         AutoCaller autoCaller (that);
     4358        AutoCaller autoCaller(that);
    43594359        /* VirtualBox has been early uninitialized, terminate */
    43604360        if (!autoCaller.isOk())
     
    43774377            bool updateSpawned = false;
    43784378
    4379             if (RT_SUCCESS (vrc))
     4379            if (RT_SUCCESS(vrc))
    43804380            {
    43814381                /* update event is signaled */
     
    44824482                                    cnt));
    44834483
    4484                         ComObjPtr <SessionMachine> sm;
     4484                        ComObjPtr<SessionMachine> sm;
    44854485                        HMTX ipcSem;
    44864486                        if ((*it)->isSessionOpenOrClosing (sm, NULL, &ipcSem))
     
    45434543    do
    45444544    {
    4545         AutoCaller autoCaller (that);
     4545        AutoCaller autoCaller(that);
    45464546        if (!autoCaller.isOk())
    45474547            break;
     
    45624562                break;
    45634563
    4564             if (RT_SUCCESS (rc) || update || updateSpawned)
     4564            if (RT_SUCCESS(rc) || update || updateSpawned)
    45654565            {
    4566                 /* RT_SUCCESS (rc) means an update event is signaled */
     4566                /* RT_SUCCESS(rc) means an update event is signaled */
    45674567
    45684568                AutoReadLock thatLock (that);
    45694569
    4570                 if (RT_SUCCESS (rc) || update)
     4570                if (RT_SUCCESS(rc) || update)
    45714571                {
    45724572                    /* obtain a new set of opened machines */
     
    45764576                         it != that->mData.mMachines.end(); ++ it)
    45774577                    {
    4578                         ComObjPtr <SessionMachine> sm;
     4578                        ComObjPtr<SessionMachine> sm;
    45794579                        if ((*it)->isSessionOpenOrClosing (sm))
    45804580                            machines.push_back (sm);
     
    45854585                }
    45864586
    4587                 if (RT_SUCCESS (rc) || updateSpawned)
     4587                if (RT_SUCCESS(rc) || updateSpawned)
    45884588                {
    45894589                    /* obtain a new set of spawned machines */
     
    46124612            /* reap child processes */
    46134613            {
    4614                 AutoWriteLock alock (that);
     4614                AutoWriteLock alock(that);
    46154615                if (that->mWatcherData.mProcesses.size())
    46164616                {
     
    46734673    LogFlowFuncEnter();
    46744674
    4675     AssertReturn (pvUser, VERR_INVALID_POINTER);
     4675    AssertReturn(pvUser, VERR_INVALID_POINTER);
    46764676
    46774677    // create an event queue for the current thread
    46784678    EventQueue *eventQ = new EventQueue();
    4679     AssertReturn (eventQ, VERR_NO_MEMORY);
     4679    AssertReturn(eventQ, VERR_NO_MEMORY);
    46804680
    46814681    // return the queue to the one who created this thread
     
    46904690        eventQ->handleEvent (event);
    46914691
    4692     AssertReturn (ok, VERR_GENERAL_FAILURE);
     4692    AssertReturn(ok, VERR_GENERAL_FAILURE);
    46934693
    46944694    delete eventQ;
     
    47144714        return NULL;
    47154715
    4716     AutoCaller autoCaller (mVirtualBox);
     4716    AutoCaller autoCaller(mVirtualBox);
    47174717    if (!autoCaller.isOk())
    47184718    {
     
    47284728    {
    47294729        /* Make a copy to release the lock before iterating */
    4730         AutoReadLock alock (mVirtualBox);
     4730        AutoReadLock alock(mVirtualBox);
    47314731        callbacks = CallbackVector (mVirtualBox->mData.mCallbacks.begin(),
    47324732                                    mVirtualBox->mData.mCallbacks.end());
     
    47524752    CheckComArgNotNull(aServer);
    47534753
    4754     AutoCaller autoCaller (this);
    4755     CheckComRCReturnRC (autoCaller.rc());
     4754    AutoCaller autoCaller(this);
     4755    CheckComRCReturnRC(autoCaller.rc());
    47564756
    47574757    ComObjPtr<DHCPServer> dhcpServer;
    47584758    dhcpServer.createObject();
    47594759    HRESULT rc = dhcpServer->init (this, aName);
    4760     CheckComRCReturnRC (rc);
     4760    CheckComRCReturnRC(rc);
    47614761
    47624762    rc = registerDHCPServer(dhcpServer, true);
    4763     CheckComRCReturnRC (rc);
     4763    CheckComRCReturnRC(rc);
    47644764
    47654765    dhcpServer.queryInterfaceTo(aServer);
     
    47784778    CheckComArgNotNull(aServer);
    47794779
    4780     AutoCaller autoCaller (this);
    4781     CheckComRCReturnRC (autoCaller.rc());
    4782 
    4783     AutoWriteLock alock (this);
     4780    AutoCaller autoCaller(this);
     4781    CheckComRCReturnRC(autoCaller.rc());
     4782
     4783    AutoWriteLock alock(this);
    47844784
    47854785    HRESULT rc;
    47864786    Bstr bstr;
    4787     ComPtr <DHCPServer> found;
     4787    ComPtr<DHCPServer> found;
    47884788
    47894789    for (DHCPServerList::const_iterator it =
     
    48054805        return E_INVALIDARG;
    48064806
    4807     return found.queryInterfaceTo (aServer);
     4807    return found.queryInterfaceTo(aServer);
    48084808}
    48094809
     
    48124812    CheckComArgNotNull(aServer);
    48134813
    4814     AutoCaller autoCaller (this);
    4815     CheckComRCReturnRC (autoCaller.rc());
     4814    AutoCaller autoCaller(this);
     4815    CheckComRCReturnRC(autoCaller.rc());
    48164816
    48174817    HRESULT rc = unregisterDHCPServer(static_cast<DHCPServer *>(aServer), true);
     
    48384838                                     bool aSaveRegistry /*= true*/)
    48394839{
    4840     AssertReturn (aDHCPServer != NULL, E_INVALIDARG);
    4841 
    4842     AutoCaller autoCaller (this);
     4840    AssertReturn(aDHCPServer != NULL, E_INVALIDARG);
     4841
     4842    AutoCaller autoCaller(this);
    48434843    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    48444844
    4845     AutoWriteLock alock (this);
     4845    AutoWriteLock alock(this);
    48464846
    48474847    AutoCaller dhcpServerCaller (aDHCPServer);
     
    48534853    HRESULT rc;
    48544854    rc = aDHCPServer->COMGETTER(NetworkName) (name.asOutParam());
    4855     CheckComRCReturnRC (rc);
     4855    CheckComRCReturnRC(rc);
    48564856
    48574857    ComPtr<IDHCPServer> existing;
     
    48934893                                       bool aSaveRegistry /*= true*/)
    48944894{
    4895     AssertReturn (aDHCPServer != NULL, E_INVALIDARG);
    4896 
    4897     AutoCaller autoCaller (this);
     4895    AssertReturn(aDHCPServer != NULL, E_INVALIDARG);
     4896
     4897    AutoCaller autoCaller(this);
    48984898    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    48994899
    4900     AutoWriteLock alock (this);
     4900    AutoWriteLock alock(this);
    49014901
    49024902    AutoCaller dhcpServerCaller (aDHCPServer);
  • trunk/src/VBox/Main/VirtualBoxImplExtra.cpp

    r17911 r21878  
    201201    int vrc = RTUtf16ToUtf8Ex (aValue.raw(), RTSTR_MAX,
    202202                               &dummy2, strLen, &strLen);
    203     if (RT_SUCCESS (vrc))
     203    if (RT_SUCCESS(vrc))
    204204    {
    205205        /* the string only contains '\0' :) */
     
    216216    }
    217217
    218     if (RT_FAILURE (vrc))
     218    if (RT_FAILURE(vrc))
    219219        throw xml::LogicError (RT_SRC_POS);
    220220
     
    241241    RTUUID uuid;
    242242    int vrc = RTUuidFromStr (&uuid, buf);
    243     if (RT_FAILURE (vrc))
     243    if (RT_FAILURE(vrc))
    244244        throw ENoConversion(com::Utf8StrFmt("'%s' is not Guid (%Rrc)", aValue, vrc));
    245245
     
    254254
    255255    int vrc = RTUuidToStr (aValue.raw(), result.get() + 1, RTUUID_STR_LENGTH);
    256     if (RT_FAILURE (vrc))
     256    if (RT_FAILURE(vrc))
    257257        throw xml::LogicError (RT_SRC_POS);
    258258
  • trunk/src/VBox/Main/darwin/HostPowerDarwin.cpp

    r18257 r21878  
    4242                             RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "MainPower");
    4343
    44     if (RT_FAILURE (rc))
     44    if (RT_FAILURE(rc))
    4545        LogFlow (("RTThreadCreate failed with %Rrc\n", rc));
    4646}
  • trunk/src/VBox/Main/darwin/NetIf-darwin.cpp

    r20475 r21878  
    5959
    6060#if 0
    61 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     61int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    6262{
    6363    int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
     
    275275}
    276276
    277 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     277int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    278278{
    279279    int rc = VINF_SUCCESS;
  • trunk/src/VBox/Main/freebsd/NetIf-freebsd.cpp

    r18971 r21878  
    3131#include "Logging.h"
    3232
    33 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     33int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    3434{
    3535    /** @todo implement */
  • trunk/src/VBox/Main/generic/NetIf-generic.cpp

    r19924 r21878  
    135135#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
    136136    /* create a progress object */
    137     ComObjPtr <Progress> progress;
     137    ComObjPtr<Progress> progress;
    138138    progress.createObject();
    139139
     
    147147        if(SUCCEEDED(rc))
    148148        {
    149             CheckComRCReturnRC (rc);
    150             progress.queryInterfaceTo (aProgress);
     149            CheckComRCReturnRC(rc);
     150            progress.queryInterfaceTo(aProgress);
    151151
    152152            char szAdpCtl[RTPATH_MAX];
     
    188188                            Bstr IfName(szBuf);
    189189                            /* create a new uninitialized host interface object */
    190                             ComObjPtr <HostNetworkInterface> iface;
     190                            ComObjPtr<HostNetworkInterface> iface;
    191191                            iface.createObject();
    192192                            iface->init(IfName, HostNetworkInterfaceType_HostOnly, pInfo);
    193                             iface.queryInterfaceTo (aHostNetworkInterface);
     193                            iface.queryInterfaceTo(aHostNetworkInterface);
    194194                        }
    195195                        RTMemFree(pInfo);
     
    218218#if defined(RT_OS_LINUX) || defined(RT_OS_DARWIN)
    219219    /* create a progress object */
    220     ComObjPtr <Progress> progress;
     220    ComObjPtr<Progress> progress;
    221221    progress.createObject();
    222222    ComPtr<IHost> host;
     
    226226    {
    227227        Bstr ifname;
    228         ComPtr <IHostNetworkInterface> iface;
     228        ComPtr<IHostNetworkInterface> iface;
    229229        if (FAILED (host->FindHostNetworkInterfaceById (Guid(aId).toUtf16(), iface.asOutParam())))
    230230            return VERR_INVALID_PARAMETER;
     
    238238        if(SUCCEEDED(rc))
    239239        {
    240             CheckComRCReturnRC (rc);
    241             progress.queryInterfaceTo (aProgress);
    242             iface.queryInterfaceTo (aHostNetworkInterface);
     240            CheckComRCReturnRC(rc);
     241            progress.queryInterfaceTo(aProgress);
     242            iface.queryInterfaceTo(aHostNetworkInterface);
    243243            rc = NetIfAdpCtl(Utf8Str(ifname), "remove", NULL, NULL);
    244244            if (RT_FAILURE(rc))
  • trunk/src/VBox/Main/glue/ErrorInfo.cpp

    r21783 r21878  
    5454#if !defined (VBOX_WITH_XPCOM)
    5555
    56     ComPtr <IErrorInfo> err;
     56    ComPtr<IErrorInfo> err;
    5757    rc = ::GetErrorInfo (0, err.asOutParam());
    5858    if (rc == S_OK && err)
     
    6161            mErrorInfo = err;
    6262
    63         ComPtr <IVirtualBoxErrorInfo> info;
    64         rc = err.queryInterfaceTo (info.asOutParam());
    65         if (SUCCEEDED (rc) && info)
     63        ComPtr<IVirtualBoxErrorInfo> info;
     64        rc = err.queryInterfaceTo(info.asOutParam());
     65        if (SUCCEEDED(rc) && info)
    6666            init (info);
    6767
     
    7171
    7272            rc = err->GetGUID (mInterfaceID.asOutParam());
    73             gotSomething |= SUCCEEDED (rc);
    74             if (SUCCEEDED (rc))
     73            gotSomething |= SUCCEEDED(rc);
     74            if (SUCCEEDED(rc))
    7575                GetInterfaceNameByIID (mInterfaceID, mInterfaceName.asOutParam());
    7676
    7777            rc = err->GetSource (mComponent.asOutParam());
    78             gotSomething |= SUCCEEDED (rc);
     78            gotSomething |= SUCCEEDED(rc);
    7979
    8080            rc = err->GetDescription (mText.asOutParam());
    81             gotSomething |= SUCCEEDED (rc);
     81            gotSomething |= SUCCEEDED(rc);
    8282
    8383            if (gotSomething)
     
    9292    nsCOMPtr <nsIExceptionService> es;
    9393    es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    94     if (NS_SUCCEEDED (rc))
     94    if (NS_SUCCEEDED(rc))
    9595    {
    9696        nsCOMPtr <nsIExceptionManager> em;
    9797        rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
    98         if (NS_SUCCEEDED (rc))
     98        if (NS_SUCCEEDED(rc))
    9999        {
    100             ComPtr <nsIException> ex;
     100            ComPtr<nsIException> ex;
    101101            rc = em->GetCurrentException (ex.asOutParam());
    102             if (NS_SUCCEEDED (rc) && ex)
     102            if (NS_SUCCEEDED(rc) && ex)
    103103            {
    104104                if (aKeepObj)
    105105                    mErrorInfo = ex;
    106106
    107                 ComPtr <IVirtualBoxErrorInfo> info;
    108                 rc = ex.queryInterfaceTo (info.asOutParam());
    109                 if (NS_SUCCEEDED (rc) && info)
     107                ComPtr<IVirtualBoxErrorInfo> info;
     108                rc = ex.queryInterfaceTo(info.asOutParam());
     109                if (NS_SUCCEEDED(rc) && info)
    110110                    init (info);
    111111
     
    115115
    116116                    rc = ex->GetResult (&mResultCode);
    117                     gotSomething |= NS_SUCCEEDED (rc);
     117                    gotSomething |= NS_SUCCEEDED(rc);
    118118
    119119                    Utf8Str message;
    120120                    rc = ex->GetMessage(message.asOutParam());
    121121                    message.jolt();
    122                     gotSomething |= NS_SUCCEEDED (rc);
    123                     if (NS_SUCCEEDED (rc))
     122                    gotSomething |= NS_SUCCEEDED(rc);
     123                    if (NS_SUCCEEDED(rc))
    124124                        mText = message;
    125125
     
    151151#if !defined (VBOX_WITH_XPCOM)
    152152
    153     ComPtr <IUnknown> iface = aI;
    154     ComPtr <ISupportErrorInfo> serr;
    155     HRESULT rc = iface.queryInterfaceTo (serr.asOutParam());
    156     if (SUCCEEDED (rc))
     153    ComPtr<IUnknown> iface = aI;
     154    ComPtr<ISupportErrorInfo> serr;
     155    HRESULT rc = iface.queryInterfaceTo(serr.asOutParam());
     156    if (SUCCEEDED(rc))
    157157    {
    158158        rc = serr->InterfaceSupportsErrorInfo (aIID);
    159         if (SUCCEEDED (rc))
     159        if (SUCCEEDED(rc))
    160160            init (aKeepObj);
    161161    }
     
    184184
    185185    rc = info->COMGETTER(ResultCode) (&lrc); mResultCode = lrc;
    186     gotSomething |= SUCCEEDED (rc);
    187     gotAll &= SUCCEEDED (rc);
     186    gotSomething |= SUCCEEDED(rc);
     187    gotAll &= SUCCEEDED(rc);
    188188
    189189    Bstr iid;
    190190    rc = info->COMGETTER(InterfaceID) (iid.asOutParam());
    191     gotSomething |= SUCCEEDED (rc);
    192     gotAll &= SUCCEEDED (rc);
    193     if (SUCCEEDED (rc))
     191    gotSomething |= SUCCEEDED(rc);
     192    gotAll &= SUCCEEDED(rc);
     193    if (SUCCEEDED(rc))
    194194    {
    195195        mInterfaceID = iid;
     
    198198
    199199    rc = info->COMGETTER(Component) (mComponent.asOutParam());
    200     gotSomething |= SUCCEEDED (rc);
    201     gotAll &= SUCCEEDED (rc);
     200    gotSomething |= SUCCEEDED(rc);
     201    gotAll &= SUCCEEDED(rc);
    202202
    203203    rc = info->COMGETTER(Text) (mText.asOutParam());
    204     gotSomething |= SUCCEEDED (rc);
    205     gotAll &= SUCCEEDED (rc);
    206 
    207     ComPtr <IVirtualBoxErrorInfo> next;
     204    gotSomething |= SUCCEEDED(rc);
     205    gotAll &= SUCCEEDED(rc);
     206
     207    ComPtr<IVirtualBoxErrorInfo> next;
    208208    rc = info->COMGETTER(Next) (next.asOutParam());
    209     if (SUCCEEDED (rc) && !next.isNull())
     209    if (SUCCEEDED(rc) && !next.isNull())
    210210    {
    211211        mNext.reset (new ErrorInfo (next));
     
    216216    else
    217217        mNext.reset();
    218     gotSomething |= SUCCEEDED (rc);
    219     gotAll &= SUCCEEDED (rc);
     218    gotSomething |= SUCCEEDED(rc);
     219    gotAll &= SUCCEEDED(rc);
    220220
    221221    mIsBasicAvailable = gotSomething;
     
    239239        return;
    240240
    241     ComPtr <IVirtualBoxErrorInfo> info;
     241    ComPtr<IVirtualBoxErrorInfo> info;
    242242    HRESULT rc = progress->COMGETTER(ErrorInfo) (info.asOutParam());
    243     if (SUCCEEDED (rc) && info)
     243    if (SUCCEEDED(rc) && info)
    244244        init (info);
    245245}
     
    257257#if !defined (VBOX_WITH_XPCOM)
    258258
    259     ComPtr <IErrorInfo> err;
     259    ComPtr<IErrorInfo> err;
    260260    if (!mErrorInfo.isNull())
    261261    {
    262         rc = mErrorInfo.queryInterfaceTo (err.asOutParam());
     262        rc = mErrorInfo.queryInterfaceTo(err.asOutParam());
    263263        AssertComRC (rc);
    264264    }
     
    269269    nsCOMPtr <nsIExceptionService> es;
    270270    es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    271     if (NS_SUCCEEDED (rc))
     271    if (NS_SUCCEEDED(rc))
    272272    {
    273273        nsCOMPtr <nsIExceptionManager> em;
    274274        rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
    275         if (NS_SUCCEEDED (rc))
     275        if (NS_SUCCEEDED(rc))
    276276        {
    277             ComPtr <nsIException> ex;
     277            ComPtr<nsIException> ex;
    278278            if (!mErrorInfo.isNull())
    279279            {
    280                 rc = mErrorInfo.queryInterfaceTo (ex.asOutParam());
     280                rc = mErrorInfo.queryInterfaceTo(ex.asOutParam());
    281281                AssertComRC (rc);
    282282            }
     
    287287#endif // !defined (VBOX_WITH_XPCOM)
    288288
    289     if (SUCCEEDED (rc))
     289    if (SUCCEEDED(rc))
    290290    {
    291291        mErrorInfo.setNull();
  • trunk/src/VBox/Main/glue/EventQueue.cpp

    r16555 r21878  
    9292    nsresult rc = NS_GetEventQueueService (getter_AddRefs (mEventQService));
    9393
    94     if (NS_SUCCEEDED (rc))
     94    if (NS_SUCCEEDED(rc))
    9595    {
    9696        rc = mEventQService->GetThreadEventQueue (NS_CURRENT_THREAD,
     
    9999        {
    100100            rc = mEventQService->CreateMonitoredThreadEventQueue();
    101             if (NS_SUCCEEDED (rc))
     101            if (NS_SUCCEEDED(rc))
    102102            {
    103103                mEQCreated = TRUE;
     
    151151    mEventQ->InitEvent (ev, this, plEventHandler, plEventDestructor);
    152152    HRESULT rc = mEventQ->PostEvent (ev);
    153     return NS_SUCCEEDED (rc);
     153    return NS_SUCCEEDED(rc);
    154154
    155155#endif
  • trunk/src/VBox/Main/glue/SupportErrorInfo.cpp

    r20267 r21878  
    114114    {
    115115        /* these are mandatory, others -- not */
    116         AssertReturn ((!aWarning && FAILED (aResultCode)) ||
     116        AssertReturn((!aWarning && FAILED (aResultCode)) ||
    117117                      (aWarning && aResultCode != S_OK),
    118118                      E_FAIL);
    119         AssertReturn (aText != NULL, E_FAIL);
    120         AssertReturn (*aText != '\0', E_FAIL);
     119        AssertReturn(aText != NULL, E_FAIL);
     120        AssertReturn(*aText != '\0', E_FAIL);
    121121
    122122        /* reset the error severity bit if it's a warning */
     
    129129    do
    130130    {
    131         ComPtr <IVirtualBoxErrorInfo> info;
     131        ComPtr<IVirtualBoxErrorInfo> info;
    132132
    133133#if !defined (VBOX_WITH_XPCOM)
    134134
    135         ComPtr <IVirtualBoxErrorInfo> curInfo;
     135        ComPtr<IVirtualBoxErrorInfo> curInfo;
    136136        if (preserve)
    137137        {
    138138            /* get the current error info if any */
    139             ComPtr <IErrorInfo> err;
     139            ComPtr<IErrorInfo> err;
    140140            rc = ::GetErrorInfo (0, err.asOutParam());
    141141            CheckComRCBreakRC (rc);
    142             rc = err.queryInterfaceTo (curInfo.asOutParam());
     142            rc = err.queryInterfaceTo(curInfo.asOutParam());
    143143            if (FAILED (rc))
    144144            {
    145145                /* create a IVirtualBoxErrorInfo wrapper for the native
    146146                 * IErrorInfo object */
    147                 ComObjPtr <VirtualBoxErrorInfo> wrapper;
     147                ComObjPtr<VirtualBoxErrorInfo> wrapper;
    148148                rc = wrapper.createObject();
    149                 if (SUCCEEDED (rc))
     149                if (SUCCEEDED(rc))
    150150                {
    151151                    rc = wrapper->init (err);
    152                     if (SUCCEEDED (rc))
     152                    if (SUCCEEDED(rc))
    153153                        curInfo = wrapper;
    154154                }
     
    156156        }
    157157        /* On failure, curInfo will stay null */
    158         Assert (SUCCEEDED (rc) || curInfo.isNull());
     158        Assert (SUCCEEDED(rc) || curInfo.isNull());
    159159
    160160        /* set the current error info and preserve the previous one if any */
     
    167167            else
    168168            {
    169                 ComObjPtr <VirtualBoxErrorInfoGlue> infoObj;
     169                ComObjPtr<VirtualBoxErrorInfoGlue> infoObj;
    170170                rc = infoObj.createObject();
    171171                CheckComRCBreakRC (rc);
     
    183183        else
    184184        {
    185             ComObjPtr <VirtualBoxErrorInfo> infoObj;
     185            ComObjPtr<VirtualBoxErrorInfo> infoObj;
    186186            rc = infoObj.createObject();
    187187            CheckComRCBreakRC (rc);
     
    193193        }
    194194
    195         ComPtr <IErrorInfo> err;
    196         rc = info.queryInterfaceTo (err.asOutParam());
    197         if (SUCCEEDED (rc))
     195        ComPtr<IErrorInfo> err;
     196        rc = info.queryInterfaceTo(err.asOutParam());
     197        if (SUCCEEDED(rc))
    198198            rc = ::SetErrorInfo (0, err);
    199199
     
    202202        nsCOMPtr <nsIExceptionService> es;
    203203        es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    204         if (NS_SUCCEEDED (rc))
     204        if (NS_SUCCEEDED(rc))
    205205        {
    206206            nsCOMPtr <nsIExceptionManager> em;
     
    208208            CheckComRCBreakRC (rc);
    209209
    210             ComPtr <IVirtualBoxErrorInfo> curInfo;
     210            ComPtr<IVirtualBoxErrorInfo> curInfo;
    211211            if (preserve)
    212212            {
    213213                /* get the current error info if any */
    214                 ComPtr <nsIException> ex;
     214                ComPtr<nsIException> ex;
    215215                rc = em->GetCurrentException (ex.asOutParam());
    216216                CheckComRCBreakRC (rc);
    217                 rc = ex.queryInterfaceTo (curInfo.asOutParam());
     217                rc = ex.queryInterfaceTo(curInfo.asOutParam());
    218218                if (FAILED (rc))
    219219                {
    220220                    /* create a IVirtualBoxErrorInfo wrapper for the native
    221221                     * nsIException object */
    222                     ComObjPtr <VirtualBoxErrorInfo> wrapper;
     222                    ComObjPtr<VirtualBoxErrorInfo> wrapper;
    223223                    rc = wrapper.createObject();
    224                     if (SUCCEEDED (rc))
     224                    if (SUCCEEDED(rc))
    225225                    {
    226226                        rc = wrapper->init (ex);
    227                         if (SUCCEEDED (rc))
     227                        if (SUCCEEDED(rc))
    228228                            curInfo = wrapper;
    229229                    }
     
    231231            }
    232232            /* On failure, curInfo will stay null */
    233             Assert (SUCCEEDED (rc) || curInfo.isNull());
     233            Assert (SUCCEEDED(rc) || curInfo.isNull());
    234234
    235235            /* set the current error info and preserve the previous one if any */
     
    242242                else
    243243                {
    244                     ComObjPtr <VirtualBoxErrorInfoGlue> infoObj;
     244                    ComObjPtr<VirtualBoxErrorInfoGlue> infoObj;
    245245                    rc = infoObj.createObject();
    246246                    CheckComRCBreakRC (rc);
     
    259259            else
    260260            {
    261                 ComObjPtr <VirtualBoxErrorInfo> infoObj;
     261                ComObjPtr<VirtualBoxErrorInfo> infoObj;
    262262                rc = infoObj.createObject();
    263263                CheckComRCBreakRC (rc);
     
    269269            }
    270270
    271             ComPtr <nsIException> ex;
    272             rc = info.queryInterfaceTo (ex.asOutParam());
    273             if (SUCCEEDED (rc))
     271            ComPtr<nsIException> ex;
     272            rc = info.queryInterfaceTo(ex.asOutParam());
     273            if (SUCCEEDED(rc))
    274274                rc = em->SetCurrentException (ex);
    275275        }
     
    298298    AssertComRC (rc);
    299299
    300     return SUCCEEDED (rc) ? aResultCode : rc;
     300    return SUCCEEDED(rc) ? aResultCode : rc;
    301301}
    302302
  • trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp

    r21786 r21878  
    7474        return E_POINTER;
    7575
    76     mIID.toUtf16().cloneTo (aIID);
     76    mIID.toUtf16().cloneTo(aIID);
    7777    return S_OK;
    7878}
     
    8383        return E_POINTER;
    8484
    85     mComponent.cloneTo (aComponent);
     85    mComponent.cloneTo(aComponent);
    8686    return S_OK;
    8787}
     
    9292        return E_POINTER;
    9393
    94     mText.cloneTo (aText);
     94    mText.cloneTo(aText);
    9595    return S_OK;
    9696}
     
    102102
    103103    /* this will set aNext to NULL if mNext is null */
    104     return mNext.queryInterfaceTo (aNext);
     104    return mNext.queryInterfaceTo(aNext);
    105105}
    106106
     
    113113HRESULT VirtualBoxErrorInfo::init (IErrorInfo *aInfo)
    114114{
    115     AssertReturn (aInfo, E_FAIL);
     115    AssertReturn(aInfo, E_FAIL);
    116116
    117117    HRESULT rc = S_OK;
     
    172172HRESULT VirtualBoxErrorInfo::init (nsIException *aInfo)
    173173{
    174     AssertReturn (aInfo, E_FAIL);
     174    AssertReturn(aInfo, E_FAIL);
    175175
    176176    HRESULT rc = S_OK;
     
    200200        return NS_ERROR_INVALID_POINTER;
    201201
    202     Utf8Str (mText).cloneTo (aMessage);
     202    Utf8Str (mText).cloneTo(aMessage);
    203203    return S_OK;
    204204}
     
    250250NS_IMETHODIMP VirtualBoxErrorInfo::GetInner (nsIException **aInner)
    251251{
    252     ComPtr <IVirtualBoxErrorInfo> info;
     252    ComPtr<IVirtualBoxErrorInfo> info;
    253253    nsresult rv = COMGETTER(Next) (info.asOutParam());
    254     CheckComRCReturnRC (rv);
    255     return info.queryInterfaceTo (aInner);
     254    CheckComRCReturnRC(rv);
     255    return info.queryInterfaceTo(aInner);
    256256}
    257257
     
    289289                                       IVirtualBoxErrorInfo *aTail)
    290290{
    291     AssertReturn (aHead != NULL, E_INVALIDARG);
    292     AssertReturn (aTail != NULL, E_INVALIDARG);
     291    AssertReturn(aHead != NULL, E_INVALIDARG);
     292    AssertReturn(aTail != NULL, E_INVALIDARG);
    293293
    294294    HRESULT rc = S_OK;
    295295
    296     typedef std::list <ComPtr <IVirtualBoxErrorInfo> > List;
     296    typedef std::list <ComPtr<IVirtualBoxErrorInfo> > List;
    297297    List list;
    298298
    299     ComPtr <IVirtualBoxErrorInfo> cur = aHead;
     299    ComPtr<IVirtualBoxErrorInfo> cur = aHead;
    300300
    301301    do
    302302    {
    303         ComPtr <IVirtualBoxErrorInfo> next;
     303        ComPtr<IVirtualBoxErrorInfo> next;
    304304        rc = cur->COMGETTER(Next) (next.asOutParam());
    305         CheckComRCReturnRC (rc);
     305        CheckComRCReturnRC(rc);
    306306
    307307        if (next.isNull())
     
    323323    for (List::iterator it = list.end(), prev = it; it != list.begin(); -- it)
    324324    {
    325         ComObjPtr <VirtualBoxErrorInfoGlue> wrapper;
     325        ComObjPtr<VirtualBoxErrorInfoGlue> wrapper;
    326326        rc = wrapper.createObject();
    327327        CheckComRCBreakRC (rc);
     
    354354                                                IVirtualBoxErrorInfo *aNext)
    355355{
    356     AssertReturn (aReal != NULL, E_INVALIDARG);
     356    AssertReturn(aReal != NULL, E_INVALIDARG);
    357357
    358358    mReal = aReal;
     
    371371
    372372    /* this will set aNext to NULL if mNext is null */
    373     return mNext.queryInterfaceTo (aNext);
     373    return mNext.queryInterfaceTo(aNext);
    374374}
    375375
  • trunk/src/VBox/Main/glue/com.cpp

    r13908 r21878  
    113113    nsCOMPtr <nsIInterfaceInfoManager> iim =
    114114        do_GetService (NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID, &rv);
    115     if (NS_SUCCEEDED (rv))
     115    if (NS_SUCCEEDED(rv))
    116116    {
    117117        nsCOMPtr <nsIInterfaceInfo> iinfo;
    118118        rv = iim->GetInfoForIID (&aIID, getter_AddRefs (iinfo));
    119         if (NS_SUCCEEDED (rv))
     119        if (NS_SUCCEEDED(rv))
    120120        {
    121121            const char *iname = NULL;
    122122            iinfo->GetNameShared (&iname);
    123123            char *utf8IName = NULL;
    124             if (RT_SUCCESS (RTStrCurrentCPToUtf8 (&utf8IName, iname)))
     124            if (RT_SUCCESS(RTStrCurrentCPToUtf8 (&utf8IName, iname)))
    125125            {
    126126                PRTUTF16 utf16IName = NULL;
    127                 if (RT_SUCCESS (RTStrToUtf16 (utf8IName, &utf16IName)))
     127                if (RT_SUCCESS(RTStrToUtf16 (utf8IName, &utf16IName)))
    128128                {
    129129                    *aName = SysAllocString ((OLECHAR *) utf16IName);
     
    140140int GetVBoxUserHomeDirectory (char *aDir, size_t aDirLen)
    141141{
    142     AssertReturn (aDir, VERR_INVALID_POINTER);
    143     AssertReturn (aDirLen > 0, VERR_BUFFER_OVERFLOW);
     142    AssertReturn(aDir, VERR_INVALID_POINTER);
     143    AssertReturn(aDirLen > 0, VERR_BUFFER_OVERFLOW);
    144144
    145145    /* start with null */
     
    156156        char *VBoxUserHomeUtf8 = NULL;
    157157        vrc = RTStrCurrentCPToUtf8 (&VBoxUserHomeUtf8, VBoxUserHome);
    158         if (RT_SUCCESS (vrc))
     158        if (RT_SUCCESS(vrc))
    159159        {
    160160            vrc = RTPathAbs (VBoxUserHomeUtf8, path, sizeof (path));
    161             if (RT_SUCCESS (vrc))
     161            if (RT_SUCCESS(vrc))
    162162            {
    163163                if (aDirLen < strlen (path) + 1)
     
    173173        /* compose the config directory (full path) */
    174174        vrc = RTPathUserHome (path, sizeof (path));
    175         if (RT_SUCCESS (vrc))
     175        if (RT_SUCCESS(vrc))
    176176        {
    177177            size_t len =
     
    184184
    185185    /* ensure the home directory exists */
    186     if (RT_SUCCESS (vrc))
     186    if (RT_SUCCESS(vrc))
    187187        if (!RTDirExists (aDir))
    188188            vrc = RTDirCreateFullPath (aDir, 0777);
  • trunk/src/VBox/Main/glue/initterm.cpp

    r18831 r21878  
    133133                                const char *aCurrProcDirLocation)
    134134{
    135     AssertReturn (aCompRegLocation, NS_ERROR_INVALID_ARG);
    136     AssertReturn (aXPTIDatLocation, NS_ERROR_INVALID_ARG);
     135    AssertReturn(aCompRegLocation, NS_ERROR_INVALID_ARG);
     136    AssertReturn(aXPTIDatLocation, NS_ERROR_INVALID_ARG);
    137137
    138138    int vrc = RTStrUtf8ToCurrentCP (&mCompRegLocation, aCompRegLocation);
    139     if (RT_SUCCESS (vrc))
     139    if (RT_SUCCESS(vrc))
    140140        vrc = RTStrUtf8ToCurrentCP (&mXPTIDatLocation, aXPTIDatLocation);
    141     if (RT_SUCCESS (vrc) && aComponentDirLocation)
     141    if (RT_SUCCESS(vrc) && aComponentDirLocation)
    142142        vrc = RTStrUtf8ToCurrentCP (&mComponentDirLocation, aComponentDirLocation);
    143     if (RT_SUCCESS (vrc) && aCurrProcDirLocation)
     143    if (RT_SUCCESS(vrc) && aCurrProcDirLocation)
    144144        vrc = RTStrUtf8ToCurrentCP (&mCurrProcDirLocation, aCurrProcDirLocation);
    145145
    146     return RT_SUCCESS (vrc) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
     146    return RT_SUCCESS(vrc) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
    147147}
    148148
     
    326326        rc = NS_GetMainEventQ (getter_AddRefs (eventQ));
    327327
    328         if (NS_SUCCEEDED (rc))
     328        if (NS_SUCCEEDED(rc))
    329329        {
    330330            PRBool isOnMainThread = PR_FALSE;
    331331            rc = eventQ->IsOnCurrentThread (&isOnMainThread);
    332             if (NS_SUCCEEDED (rc) && isOnMainThread)
     332            if (NS_SUCCEEDED(rc) && isOnMainThread)
    333333                ++ gXPCOMInitCount;
    334334        }
     
    395395            vrc = RTPathAppPrivateArch (appHomeDir, sizeof (appHomeDir));
    396396            AssertRC (vrc);
    397             if (RT_FAILURE (vrc))
     397            if (RT_FAILURE(vrc))
    398398            {
    399399                rc = NS_ERROR_FAILURE;
     
    431431            char *appDirCP = NULL;
    432432            vrc = RTStrUtf8ToCurrentCP (&appDirCP, appHomeDir);
    433             if (RT_SUCCESS (vrc))
     433            if (RT_SUCCESS(vrc))
    434434            {
    435435                nsCOMPtr <nsILocalFile> file;
    436436                rc = NS_NewNativeLocalFile (nsEmbedCString (appDirCP),
    437437                                            PR_FALSE, getter_AddRefs (file));
    438                 if (NS_SUCCEEDED (rc))
     438                if (NS_SUCCEEDED(rc))
    439439                    appDir = do_QueryInterface (file, &rc);
    440440
     
    452452            char *pathCP = NULL;
    453453            vrc = RTStrUtf8ToCurrentCP (&pathCP, appHomeDir);
    454             if (RT_SUCCESS (vrc))
     454            if (RT_SUCCESS(vrc))
    455455            {
    456456                vrc = RTEnvSet ("VBOX_XPCOM_HOME", pathCP);
     
    466466                                appDir, dsProv);
    467467
    468             if (NS_SUCCEEDED (rc))
     468            if (NS_SUCCEEDED(rc))
    469469            {
    470470                nsCOMPtr <nsIComponentRegistrar> registrar =
    471471                    do_QueryInterface (serviceManager, &rc);
    472                 if (NS_SUCCEEDED (rc))
     472                if (NS_SUCCEEDED(rc))
    473473                {
    474474                    rc = registrar->AutoRegister (nsnull);
    475                     if (NS_SUCCEEDED (rc))
     475                    if (NS_SUCCEEDED(rc))
    476476                    {
    477477                        /* We succeeded, stop probing paths */
     
    513513    rc = NS_GetMainEventQ (getter_AddRefs (eventQ));
    514514
    515     if (NS_SUCCEEDED (rc) || rc == NS_ERROR_NOT_AVAILABLE)
     515    if (NS_SUCCEEDED(rc) || rc == NS_ERROR_NOT_AVAILABLE)
    516516    {
    517517        /* NS_ERROR_NOT_AVAILABLE seems to mean that
     
    523523
    524524        PRBool isOnMainThread = PR_FALSE;
    525         if (NS_SUCCEEDED (rc))
     525        if (NS_SUCCEEDED(rc))
    526526        {
    527527            rc = eventQ->IsOnCurrentThread (&isOnMainThread);
     
    534534        }
    535535
    536         if (NS_SUCCEEDED (rc) && isOnMainThread)
     536        if (NS_SUCCEEDED(rc) && isOnMainThread)
    537537        {
    538538            /* only the main thread needs to uninitialize XPCOM and only if
  • trunk/src/VBox/Main/hgcm/HGCM.cpp

    r21227 r21878  
    263263        rc = RTLdrGetSymbol (m_hLdrMod, VBOX_HGCM_SVCLOAD_NAME, (void**)&m_pfnLoad);
    264264
    265         if (RT_FAILURE (rc) || !m_pfnLoad)
     265        if (RT_FAILURE(rc) || !m_pfnLoad)
    266266        {
    267267            Log(("HGCMService::loadServiceDLL: Error resolving the service entry point %s, rc = %d, m_pfnLoad = %p\n", VBOX_HGCM_SVCLOAD_NAME, rc, m_pfnLoad));
     
    286286            LogFlowFunc(("m_pfnLoad rc = %Rrc\n", rc));
    287287
    288             if (RT_SUCCESS (rc))
     288            if (RT_SUCCESS(rc))
    289289            {
    290290                if (   m_fntable.pfnUnload == NULL
     
    475475        int rc = hgcmMsgGet (ThreadHandle, &pMsgCore);
    476476
    477         if (RT_FAILURE (rc))
     477        if (RT_FAILURE(rc))
    478478        {
    479479            /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */
     
    646646                    }
    647647
    648                     if (RT_SUCCESS (rc))
     648                    if (RT_SUCCESS(rc))
    649649                    {
    650650                        pSvc->m_hExtension = pMsg->handle;
     
    805805        rc = hgcmMsgSend (hMsg);
    806806
    807         if (RT_SUCCESS (rc))
     807        if (RT_SUCCESS(rc))
    808808        {
    809809            hgcmThreadWait (m_thread);
     
    884884    int rc = HGCMService::ResolveService (&pSvc, pszServiceName);
    885885
    886     if (RT_SUCCESS (rc))
     886    if (RT_SUCCESS(rc))
    887887    {
    888888        /* The service is already loaded. */
     
    12961296            rc = hgcmMsgSend (hMsg);
    12971297
    1298             if (RT_SUCCESS (rc))
     1298            if (RT_SUCCESS(rc))
    12991299            {
    13001300                /* Add the client Id to the array. */
     
    13611361    }
    13621362
    1363     if (RT_SUCCESS (rc))
     1363    if (RT_SUCCESS(rc))
    13641364    {
    13651365        /* Remove the client id from the array in any case. */
     
    16461646        int rc = hgcmMsgGet (ThreadHandle, &pMsgCore);
    16471647
    1648         if (RT_FAILURE (rc))
     1648        if (RT_FAILURE(rc))
    16491649        {
    16501650            /* The error means some serious unrecoverable problem in the hgcmMsg/hgcmThread layer. */
     
    16691669                rc = HGCMService::ResolveService (&pService, pMsg->pszServiceName);
    16701670
    1671                 if (RT_SUCCESS (rc))
     1671                if (RT_SUCCESS(rc))
    16721672                {
    16731673                    /* Call the service instance method. */
     
    17241724                rc = HGCMService::ResolveService (&pService, pMsg->pszServiceName);
    17251725
    1726                 if (RT_SUCCESS (rc))
     1726                if (RT_SUCCESS(rc))
    17271727                {
    17281728                    rc = pService->HostCall (pMsg->u32Function, pMsg->cParms, pMsg->paParms);
     
    17891789                    rc = HGCMService::ResolveService (&pService, handle->pszServiceName);
    17901790
    1791                     if (RT_SUCCESS (rc))
     1791                    if (RT_SUCCESS(rc))
    17921792                    {
    17931793                        pService->RegisterExtension (handle, pMsg->pfnExtension, pMsg->pvExtension);
     
    17961796                    }
    17971797
    1798                     if (RT_FAILURE (rc))
     1798                    if (RT_FAILURE(rc))
    17991799                    {
    18001800                        RTMemFree (handle);
     
    18161816                rc = HGCMService::ResolveService (&pService, pMsg->handle->pszServiceName);
    18171817
    1818                 if (RT_SUCCESS (rc))
     1818                if (RT_SUCCESS(rc))
    18191819                {
    18201820                    pService->UnregisterExtension (pMsg->handle);
     
    22362236        rc = hgcmThreadCreate (&g_hgcmThread, "MainHGCMthread", hgcmThread, NULL);
    22372237
    2238         if (RT_FAILURE (rc))
     2238        if (RT_FAILURE(rc))
    22392239        {
    22402240            LogRel(("Failed to start HGCM thread. HGCM services will be unavailable!!! rc = %Rrc\n", rc));
     
    22562256    int rc = HGCMHostReset ();
    22572257
    2258     if (RT_SUCCESS (rc))
     2258    if (RT_SUCCESS(rc))
    22592259    {
    22602260        /* Send the quit message to the main hgcmThread. */
     
    22672267            rc = hgcmMsgSend (hMsg);
    22682268
    2269             if (RT_SUCCESS (rc))
     2269            if (RT_SUCCESS(rc))
    22702270            {
    22712271                /* Wait for the thread termination. */
  • trunk/src/VBox/Main/hgcm/HGCMThread.cpp

    r13837 r21878  
    301301                    rc = RTThreadUserWait (thread, 30000);
    302302                    AssertRC (rc);
    303                     Assert (!(m_fu32ThreadFlags & HGCMMSG_TF_INITIALIZING) || RT_FAILURE (rc));
     303                    Assert (!(m_fu32ThreadFlags & HGCMMSG_TF_INITIALIZING) || RT_FAILURE(rc));
    304304                }
    305305                else
     
    335335
    336336#ifdef LOG_ENABLED
    337     if (RT_FAILURE (rc))
     337    if (RT_FAILURE(rc))
    338338    {
    339339        Log(("HGCMThread::MsgPost: FAILURE: could not obtain worker thread mutex, rc = %Rrc!!!\n", rc));
     
    476476            rc = Enter ();
    477477
    478             if (RT_FAILURE (rc))
     478            if (RT_FAILURE(rc))
    479479            {
    480480                break;
     
    638638    }
    639639
    640     if (RT_SUCCESS (rc))
     640    if (RT_SUCCESS(rc))
    641641    {
    642642        *pHandle = handle;
     
    739739    int rc = hgcmMsgPostInternal (hMsg, pfnCallback, false);
    740740
    741     if (RT_SUCCESS (rc))
     741    if (RT_SUCCESS(rc))
    742742    {
    743743        rc = VINF_HGCM_ASYNC_EXECUTE;
  • trunk/src/VBox/Main/include/ApplianceImpl.h

    r21827 r21878  
    8686private:
    8787    /** weak VirtualBox parent */
    88     const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     88    const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    8989
    9090    struct Data;            // opaque, defined in ApplianceImpl.cpp
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r21823 r21878  
    107107private:
    108108
    109     const ComObjPtr <Machine, ComWeakRef> mParent;
    110     const ComObjPtr <AudioAdapter> mPeer;
     109    const ComObjPtr<Machine, ComWeakRef> mParent;
     110    const ComObjPtr<AudioAdapter> mPeer;
    111111
    112112    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/AudioSnifferInterface.h

    r14949 r21878  
    4848    static DECLCALLBACK(void)   drvDestruct(PPDMDRVINS pDrvIns);
    4949
    50     ComObjPtr <Console, ComWeakRef> mParent;
     50    ComObjPtr<Console, ComWeakRef> mParent;
    5151};
    5252
  • trunk/src/VBox/Main/include/BIOSSettingsImpl.h

    r21823 r21878  
    136136private:
    137137
    138     ComObjPtr <Machine, ComWeakRef> mParent;
    139     ComObjPtr <BIOSSettings> mPeer;
     138    ComObjPtr<Machine, ComWeakRef> mParent;
     139    ComObjPtr<BIOSSettings> mPeer;
    140140    Backupable <Data> mData;
    141141};
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r21823 r21878  
    165165    MachineDebugger *getMachineDebugger() const { return mDebugger; }
    166166
    167     const ComPtr <IMachine> &machine() const { return mMachine; }
     167    const ComPtr<IMachine> &machine() const { return mMachine; }
    168168
    169169    /** Method is called only from ConsoleVRDPServer */
     
    389389        BOOL mWritable;
    390390    };
    391     typedef std::map <Bstr, ComObjPtr <SharedFolder> > SharedFolderMap;
     391    typedef std::map <Bstr, ComObjPtr<SharedFolder> > SharedFolderMap;
    392392    typedef std::map <Bstr, SharedFolderData> SharedFolderDataMap;
    393393
    394394private:
    395395
    396     typedef std::list <ComObjPtr <OUSBDevice> > USBDeviceList;
    397     typedef std::list <ComObjPtr <RemoteUSBDevice> > RemoteUSBDeviceList;
     396    typedef std::list <ComObjPtr<OUSBDevice> > USBDeviceList;
     397    typedef std::list <ComObjPtr<RemoteUSBDevice> > RemoteUSBDeviceList;
    398398
    399399    HRESULT addVMCaller (bool aQuiet = false, bool aAllowNullVM = false);
    400400    void releaseVMCaller();
    401401
    402     HRESULT consoleInitReleaseLog (const ComPtr <IMachine> aMachine);
     402    HRESULT consoleInitReleaseLog (const ComPtr<IMachine> aMachine);
    403403
    404404    HRESULT powerUp (IProgress **aProgress, bool aPaused);
     
    418418
    419419    HRESULT findSharedFolder (CBSTR aName,
    420                               ComObjPtr <SharedFolder> &aSharedFolder,
     420                              ComObjPtr<SharedFolder> &aSharedFolder,
    421421                              bool aSetError = false);
    422422
     
    516516    bool mSavedStateDataLoaded : 1;
    517517
    518     const ComPtr <IMachine> mMachine;
    519     const ComPtr <IInternalMachineControl> mControl;
    520 
    521     const ComPtr <IVRDPServer> mVRDPServer;
    522     const ComPtr <IDVDDrive> mDVDDrive;
    523     const ComPtr <IFloppyDrive> mFloppyDrive;
     518    const ComPtr<IMachine> mMachine;
     519    const ComPtr<IInternalMachineControl> mControl;
     520
     521    const ComPtr<IVRDPServer> mVRDPServer;
     522    const ComPtr<IDVDDrive> mDVDDrive;
     523    const ComPtr<IFloppyDrive> mFloppyDrive;
    524524
    525525    ConsoleVRDPServer * const mConsoleVRDPServer;
    526526
    527     const ComObjPtr <Guest> mGuest;
    528     const ComObjPtr <Keyboard> mKeyboard;
    529     const ComObjPtr <Mouse> mMouse;
    530     const ComObjPtr <Display> mDisplay;
    531     const ComObjPtr <MachineDebugger> mDebugger;
    532     const ComObjPtr <RemoteDisplayInfo> mRemoteDisplayInfo;
     527    const ComObjPtr<Guest> mGuest;
     528    const ComObjPtr<Keyboard> mKeyboard;
     529    const ComObjPtr<Mouse> mMouse;
     530    const ComObjPtr<Display> mDisplay;
     531    const ComObjPtr<MachineDebugger> mDebugger;
     532    const ComObjPtr<RemoteDisplayInfo> mRemoteDisplayInfo;
    533533
    534534    USBDeviceList mUSBDevices;
     
    589589    MachineState_T mMachineState;
    590590
    591     typedef std::list <ComPtr <IConsoleCallback> > CallbackList;
     591    typedef std::list <ComPtr<IConsoleCallback> > CallbackList;
    592592    CallbackList mCallbacks;
    593593
  • trunk/src/VBox/Main/include/ConsoleVRDPServer.h

    r21823 r21878  
    286286private:
    287287
    288     const ComObjPtr <Console, ComWeakRef> mParent;
     288    const ComObjPtr<Console, ComWeakRef> mParent;
    289289};
    290290
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r21823 r21878  
    8686private:
    8787    /** weak VirtualBox parent */
    88     const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     88    const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    8989
    9090    const Bstr mName;
  • trunk/src/VBox/Main/include/DVDDriveImpl.h

    r21823 r21878  
    5656
    5757        ComObjPtr<DVDImage> image;
    58         ComPtr <IHostDVDDrive> hostDrive;
     58        ComPtr<IHostDVDDrive> hostDrive;
    5959        DriveState_T state;
    6060        BOOL passthrough;
     
    121121private:
    122122
    123     const ComObjPtr <Machine, ComWeakRef> mParent;
    124     const ComObjPtr <DVDDrive> mPeer;
     123    const ComObjPtr<Machine, ComWeakRef> mParent;
     124    const ComObjPtr<DVDDrive> mPeer;
    125125
    126126    Backupable <Data> m;
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r21823 r21878  
    280280    static DECLCALLBACK(int)    displaySSMLoad (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version);
    281281
    282     const ComObjPtr <Console, ComWeakRef> mParent;
     282    const ComObjPtr<Console, ComWeakRef> mParent;
    283283    /** Pointer to the associated display driver. */
    284284    struct DRVMAINDISPLAY  *mpDrv;
  • trunk/src/VBox/Main/include/FloppyDriveImpl.h

    r21823 r21878  
    5757        BOOL enabled;
    5858        ComObjPtr<FloppyImage> image;
    59         ComPtr <IHostFloppyDrive> hostDrive;
     59        ComPtr<IHostFloppyDrive> hostDrive;
    6060        DriveState_T state;
    6161    };
     
    121121private:
    122122
    123     const ComObjPtr <Machine, ComWeakRef> mParent;
    124     const ComObjPtr <FloppyDrive> mPeer;
     123    const ComObjPtr<Machine, ComWeakRef> mParent;
     124    const ComObjPtr<FloppyDrive> mPeer;
    125125
    126126    Backupable <Data> m;
  • trunk/src/VBox/Main/include/GuestImpl.h

    r21823 r21878  
    107107    ULONG mCurrentGuestStat[GuestStatisticType_MaxVal];
    108108
    109     ComObjPtr <Console, ComWeakRef> mParent;
     109    ComObjPtr<Console, ComWeakRef> mParent;
    110110    Data mData;
    111111};
  • trunk/src/VBox/Main/include/HardDiskAttachmentImpl.h

    r21823 r21878  
    6464        }
    6565
    66         const ComObjPtr <HardDisk> hardDisk;
     66        const ComObjPtr<HardDisk> hardDisk;
    6767    };
    6868
  • trunk/src/VBox/Main/include/HardDiskImpl.h

    r21823 r21878  
    156156     * and implies the progress object will be used for waiting.
    157157     */
    158     HRESULT deleteStorageNoWait (ComObjPtr <Progress> &aProgress)
     158    HRESULT deleteStorageNoWait (ComObjPtr<Progress> &aProgress)
    159159    { return deleteStorage (&aProgress, false /* aWait */); }
    160160
     
    163163     * blocking the current thread.
    164164     */
    165     HRESULT deleteStorageAndWait (ComObjPtr <Progress> *aProgress = NULL)
     165    HRESULT deleteStorageAndWait (ComObjPtr<Progress> *aProgress = NULL)
    166166    { return deleteStorage (aProgress, true /* aWait */); }
    167167
     
    172172    HRESULT createDiffStorageNoWait (ComObjPtr<HardDisk> &aTarget,
    173173                                     HardDiskVariant_T aVariant,
    174                                      ComObjPtr <Progress> &aProgress)
     174                                     ComObjPtr<Progress> &aProgress)
    175175    { return createDiffStorage (aTarget, aVariant, &aProgress, false /* aWait */); }
    176176
     
    181181    HRESULT createDiffStorageAndWait (ComObjPtr<HardDisk> &aTarget,
    182182                                      HardDiskVariant_T aVariant,
    183                                       ComObjPtr <Progress> *aProgress = NULL)
     183                                      ComObjPtr<Progress> *aProgress = NULL)
    184184    { return createDiffStorage (aTarget, aVariant, aProgress, true /* aWait */); }
    185185
     
    192192     */
    193193    HRESULT mergeToNoWait (MergeChain *aChain,
    194                            ComObjPtr <Progress> &aProgress)
     194                           ComObjPtr<Progress> &aProgress)
    195195    { return mergeTo (aChain, &aProgress, false /* aWait */); }
    196196
     
    200200     */
    201201    HRESULT mergeToAndWait (MergeChain *aChain,
    202                             ComObjPtr <Progress> *aProgress = NULL)
     202                            ComObjPtr<Progress> *aProgress = NULL)
    203203    { return mergeTo (aChain, aProgress, true /* aWait */); }
    204204
     
    208208
    209209    HRESULT prepareDiscard (MergeChain * &aChain);
    210     HRESULT discard (ComObjPtr <Progress> &aProgress, MergeChain *aChain);
     210    HRESULT discard (ComObjPtr<Progress> &aProgress, MergeChain *aChain);
    211211    void cancelDiscard (MergeChain *aChain);
    212212
     
    217217    // a caller and a read lock before calling them!)
    218218
    219     ComObjPtr <HardDisk> parent() const { return static_cast <HardDisk *> (mParent); }
     219    ComObjPtr<HardDisk> parent() const { return static_cast <HardDisk *> (mParent); }
    220220    HardDiskType_T type() const { return mm.type; }
    221221
     
    225225protected:
    226226
    227     HRESULT deleteStorage (ComObjPtr <Progress> *aProgress, bool aWait);
    228 
    229     HRESULT createDiffStorage (ComObjPtr <HardDisk> &aTarget,
     227    HRESULT deleteStorage (ComObjPtr<Progress> *aProgress, bool aWait);
     228
     229    HRESULT createDiffStorage (ComObjPtr<HardDisk> &aTarget,
    230230                               HardDiskVariant_T aVariant,
    231                                ComObjPtr <Progress> *aProgress,
     231                               ComObjPtr<Progress> *aProgress,
    232232                               bool aWait);
    233233
    234234    HRESULT mergeTo (MergeChain *aChain,
    235                      ComObjPtr <Progress> *aProgress,
     235                     ComObjPtr<Progress> *aProgress,
    236236                     bool aWait);
    237237
     
    285285
    286286    /** weak parent */
    287     ComObjPtr <HardDisk, ComWeakRef> mParent;
     287    ComObjPtr<HardDisk, ComWeakRef> mParent;
    288288
    289289    struct Task;
     
    306306
    307307        const Bstr format;
    308         ComObjPtr <HardDiskFormat> formatObj;
     308        ComObjPtr<HardDiskFormat> formatObj;
    309309
    310310        HardDiskType_T type;
  • trunk/src/VBox/Main/include/HostImpl.h

    r21823 r21878  
    119119
    120120#ifdef VBOX_WITH_USB
    121     typedef std::list <ComObjPtr <HostUSBDeviceFilter> > USBDeviceFilterList;
     121    typedef std::list <ComObjPtr<HostUSBDeviceFilter> > USBDeviceFilterList;
    122122
    123123    /** Must be called from under this object's lock. */
     
    135135
    136136#if (defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)) && defined(VBOX_USE_LIBHAL)
    137     bool getDVDInfoFromHal(std::list <ComObjPtr <HostDVDDrive> > &list);
    138     bool getFloppyInfoFromHal(std::list <ComObjPtr <HostFloppyDrive> > &list);
     137    bool getDVDInfoFromHal(std::list <ComObjPtr<HostDVDDrive> > &list);
     138    bool getFloppyInfoFromHal(std::list <ComObjPtr<HostFloppyDrive> > &list);
    139139#endif
    140140
    141141#if defined(RT_OS_SOLARIS)
    142     void parseMountTable(char *mountTable, std::list <ComObjPtr <HostDVDDrive> > &list);
     142    void parseMountTable(char *mountTable, std::list <ComObjPtr<HostDVDDrive> > &list);
    143143    bool validateDevice(const char *deviceNode, bool isCDROM);
    144144#endif
     
    146146#ifdef VBOX_WITH_USB
    147147    /** specialization for IHostUSBDeviceFilter */
    148     ComObjPtr <HostUSBDeviceFilter> getDependentChild (IHostUSBDeviceFilter *aFilter)
     148    ComObjPtr<HostUSBDeviceFilter> getDependentChild (IHostUSBDeviceFilter *aFilter)
    149149    {
    150150        VirtualBoxBase *child = VirtualBoxBaseWithChildren::
    151                                 getDependentChild (ComPtr <IUnknown> (aFilter));
     151                                getDependentChild (ComPtr<IUnknown> (aFilter));
    152152        return child ? dynamic_cast <HostUSBDeviceFilter *> (child)
    153153                     : NULL;
     
    160160#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    161161
    162     ComObjPtr <VirtualBox, ComWeakRef> mParent;
     162    ComObjPtr<VirtualBox, ComWeakRef> mParent;
    163163
    164164#ifdef VBOX_WITH_USB
  • trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h

    r21823 r21878  
    9797    HostNetworkInterfaceType_T mIfType;
    9898
    99     ComObjPtr <VirtualBox, ComWeakRef> mVBox;
     99    ComObjPtr<VirtualBox, ComWeakRef> mVBox;
    100100
    101101    struct Data
  • trunk/src/VBox/Main/include/HostPower.h

    r15905 r21878  
    5353protected:
    5454
    55     ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     55    ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    5656
    57     std::vector <ComPtr <IConsole> > mConsoles;
     57    std::vector <ComPtr<IConsole> > mConsoles;
    5858};
    5959
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r21823 r21878  
    100100    static DECLCALLBACK(void)   drvDestruct(PPDMDRVINS pDrvIns);
    101101
    102     const ComObjPtr <Console, ComWeakRef> mParent;
     102    const ComObjPtr<Console, ComWeakRef> mParent;
    103103    /** Pointer to the associated keyboard driver. */
    104104    struct DRVMAINKEYBOARD *mpDrv;
  • trunk/src/VBox/Main/include/MachineDebuggerImpl.h

    r21823 r21878  
    9898    bool queueSettings() const;
    9999
    100     const ComObjPtr <Console, ComWeakRef> mParent;
     100    const ComObjPtr<Console, ComWeakRef> mParent;
    101101    // flags whether settings have been queued because
    102102    // they could not be sent to the VM (not up yet, etc.)
  • trunk/src/VBox/Main/include/MachineImpl.h

    r21835 r21878  
    111111        {
    112112            /** Control of the direct session opened by openSession() */
    113             ComPtr <IInternalSessionControl> mDirectControl;
    114 
    115             typedef std::list <ComPtr <IInternalSessionControl> > RemoteControlList;
     113            ComPtr<IInternalSessionControl> mDirectControl;
     114
     115            typedef std::list <ComPtr<IInternalSessionControl> > RemoteControlList;
    116116
    117117            /** list of controls of all opened remote sessions */
     
    119119
    120120            /** openRemoteSession() and OnSessionEnd() progress indicator */
    121             ComObjPtr <Progress> mProgress;
     121            ComObjPtr<Progress> mProgress;
    122122
    123123            /**
     
    135135
    136136            /** Session machine object */
    137             ComObjPtr <SessionMachine> mMachine;
     137            ComObjPtr<SessionMachine> mMachine;
    138138
    139139            /**
     
    142142             * reading.
    143143             */
    144             typedef std::list <std::pair <ComPtr <IMedium>, bool > > LockedMedia;
     144            typedef std::list <std::pair <ComPtr<IMedium>, bool > > LockedMedia;
    145145            LockedMedia mLockedMedia;
    146146        };
     
    276276        DeviceType_T   mBootOrder [SchemaDefs::MaxBootPosition];
    277277
    278         typedef std::list <ComObjPtr <SharedFolder> > SharedFolderList;
     278        typedef std::list <ComObjPtr<SharedFolder> > SharedFolderList;
    279279        SharedFolderList mSharedFolders;
    280280        ClipboardMode_T mClipboardMode;
     
    597597     * one) or after doing addCaller() manually.
    598598     */
    599     const ComObjPtr <VirtualBox, ComWeakRef> &virtualBox() const { return mParent; }
     599    const ComObjPtr<VirtualBox, ComWeakRef> &virtualBox() const { return mParent; }
    600600
    601601    /**
     
    662662#if defined (RT_OS_WINDOWS)
    663663
    664     bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    665                         ComPtr <IInternalSessionControl> *aControl = NULL,
     664    bool isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     665                        ComPtr<IInternalSessionControl> *aControl = NULL,
    666666                        HANDLE *aIPCSem = NULL, bool aAllowClosing = false);
    667667    bool isSessionSpawning (RTPROCESS *aPID = NULL);
    668668
    669     bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine,
    670                                  ComPtr <IInternalSessionControl> *aControl = NULL,
     669    bool isSessionOpenOrClosing (ComObjPtr<SessionMachine> &aMachine,
     670                                 ComPtr<IInternalSessionControl> *aControl = NULL,
    671671                                 HANDLE *aIPCSem = NULL)
    672672    { return isSessionOpen (aMachine, aControl, aIPCSem, true /* aAllowClosing */); }
     
    674674#elif defined (RT_OS_OS2)
    675675
    676     bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    677                         ComPtr <IInternalSessionControl> *aControl = NULL,
     676    bool isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     677                        ComPtr<IInternalSessionControl> *aControl = NULL,
    678678                        HMTX *aIPCSem = NULL, bool aAllowClosing = false);
    679679
    680680    bool isSessionSpawning (RTPROCESS *aPID = NULL);
    681681
    682     bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine,
    683                                  ComPtr <IInternalSessionControl> *aControl = NULL,
     682    bool isSessionOpenOrClosing (ComObjPtr<SessionMachine> &aMachine,
     683                                 ComPtr<IInternalSessionControl> *aControl = NULL,
    684684                                 HMTX *aIPCSem = NULL)
    685685    { return isSessionOpen (aMachine, aControl, aIPCSem, true /* aAllowClosing */); }
     
    687687#else
    688688
    689     bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    690                         ComPtr <IInternalSessionControl> *aControl = NULL,
     689    bool isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     690                        ComPtr<IInternalSessionControl> *aControl = NULL,
    691691                        bool aAllowClosing = false);
    692692    bool isSessionSpawning();
    693693
    694     bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine,
    695                                  ComPtr <IInternalSessionControl> *aControl = NULL)
     694    bool isSessionOpenOrClosing (ComObjPtr<SessionMachine> &aMachine,
     695                                 ComPtr<IInternalSessionControl> *aControl = NULL)
    696696    { return isSessionOpen (aMachine, aControl, true /* aAllowClosing */); }
    697697
     
    703703
    704704    HRESULT getSharedFolder (CBSTR aName,
    705                              ComObjPtr <SharedFolder> &aSharedFolder,
     705                             ComObjPtr<SharedFolder> &aSharedFolder,
    706706                             bool aSetError = false)
    707707    {
     
    753753
    754754    HRESULT findSharedFolder (CBSTR aName,
    755                               ComObjPtr <SharedFolder> &aSharedFolder,
     755                              ComObjPtr<SharedFolder> &aSharedFolder,
    756756                              bool aSetError = false);
    757757
     
    770770                              settings::Key *aSnapshotNode);
    771771
    772     HRESULT findSnapshot (const Guid &aId, ComObjPtr <Snapshot> &aSnapshot,
     772    HRESULT findSnapshot (const Guid &aId, ComObjPtr<Snapshot> &aSnapshot,
    773773                          bool aSetError = false);
    774     HRESULT findSnapshot (IN_BSTR aName, ComObjPtr <Snapshot> &aSnapshot,
     774    HRESULT findSnapshot (IN_BSTR aName, ComObjPtr<Snapshot> &aSnapshot,
    775775                          bool aSetError = false);
    776776
    777777    HRESULT getStorageControllerByName(CBSTR aName,
    778                                        ComObjPtr <StorageController> &aStorageController,
     778                                       ComObjPtr<StorageController> &aStorageController,
    779779                                       bool aSetError = false);
    780780
     
    817817
    818818    HRESULT createImplicitDiffs (const Bstr &aFolder,
    819                                  ComObjPtr <Progress> &aProgress,
     819                                 ComObjPtr<Progress> &aProgress,
    820820                                 bool aOnline);
    821821    HRESULT deleteImplicitDiffs();
     
    847847    const InstanceType mType;
    848848
    849     const ComObjPtr <Machine, ComWeakRef> mPeer;
    850 
    851     const ComObjPtr <VirtualBox, ComWeakRef> mParent;
     849    const ComObjPtr<Machine, ComWeakRef> mPeer;
     850
     851    const ComObjPtr<VirtualBox, ComWeakRef> mParent;
    852852
    853853    Shareable <Data> mData;
     
    861861    // so they cannot be a part of HWData
    862862
    863     const ComObjPtr <VRDPServer> mVRDPServer;
    864     const ComObjPtr <DVDDrive> mDVDDrive;
    865     const ComObjPtr <FloppyDrive> mFloppyDrive;
    866     const ComObjPtr <SerialPort>
     863    const ComObjPtr<VRDPServer> mVRDPServer;
     864    const ComObjPtr<DVDDrive> mDVDDrive;
     865    const ComObjPtr<FloppyDrive> mFloppyDrive;
     866    const ComObjPtr<SerialPort>
    867867        mSerialPorts [SchemaDefs::SerialPortCount];
    868     const ComObjPtr <ParallelPort>
     868    const ComObjPtr<ParallelPort>
    869869        mParallelPorts [SchemaDefs::ParallelPortCount];
    870     const ComObjPtr <AudioAdapter> mAudioAdapter;
    871     const ComObjPtr <USBController> mUSBController;
    872     const ComObjPtr <BIOSSettings> mBIOSSettings;
    873     const ComObjPtr <NetworkAdapter>
     870    const ComObjPtr<AudioAdapter> mAudioAdapter;
     871    const ComObjPtr<USBController> mUSBController;
     872    const ComObjPtr<BIOSSettings> mBIOSSettings;
     873    const ComObjPtr<NetworkAdapter>
    874874        mNetworkAdapters [SchemaDefs::NetworkAdapterCount];
    875875
     
    977977    HRESULT onSharedFolderChange();
    978978
    979     bool hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
     979    bool hasMatchingUSBFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    980980
    981981private:
     
    988988
    989989        // used when taking snapshot
    990         ComObjPtr <Snapshot> mSnapshot;
    991         ComObjPtr <Progress> mServerProgress;
    992         ComObjPtr <CombinedProgress> mCombinedProgress;
     990        ComObjPtr<Snapshot> mSnapshot;
     991        ComObjPtr<Progress> mServerProgress;
     992        ComObjPtr<CombinedProgress> mCombinedProgress;
    993993
    994994        // used when saving state
     
    10161016    HRESULT endTakingSnapshot (BOOL aSuccess);
    10171017
    1018     typedef std::map <ComObjPtr <Machine>, MachineState_T> AffectedMachines;
     1018    typedef std::map <ComObjPtr<Machine>, MachineState_T> AffectedMachines;
    10191019
    10201020    void takeSnapshotHandler (TakeSnapshotTask &aTask);
     
    10361036    HANDLE mIPCSem;
    10371037    Bstr mIPCSemName;
    1038     friend bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    1039                                         ComPtr <IInternalSessionControl> *aControl,
     1038    friend bool Machine::isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     1039                                        ComPtr<IInternalSessionControl> *aControl,
    10401040                                        HANDLE *aIPCSem, bool aAllowClosing);
    10411041#elif defined (RT_OS_OS2)
    10421042    HMTX mIPCSem;
    10431043    Bstr mIPCSemName;
    1044     friend bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    1045                                         ComPtr <IInternalSessionControl> *aControl,
     1044    friend bool Machine::isSessionOpen (ComObjPtr<SessionMachine> &aMachine,
     1045                                        ComPtr<IInternalSessionControl> *aControl,
    10461046                                        HMTX *aIPCSem, bool aAllowClosing);
    10471047#elif defined (VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
  • trunk/src/VBox/Main/include/MediumImpl.h

    r21823 r21878  
    172172
    173173    /** weak VirtualBox parent */
    174     const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     174    const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    175175
    176176    struct Data
  • trunk/src/VBox/Main/include/MouseImpl.h

    r21823 r21878  
    101101    static DECLCALLBACK(void)   drvDestruct(PPDMDRVINS pDrvIns);
    102102
    103     const ComObjPtr <Console, ComWeakRef> mParent;
     103    const ComObjPtr<Console, ComWeakRef> mParent;
    104104    /** Pointer to the associated mouse driver. */
    105105    struct DRVMAINMOUSE    *mpDrv;
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r21823 r21878  
    157157    void generateMACAddress();
    158158
    159     const ComObjPtr <Machine, ComWeakRef> mParent;
    160     const ComObjPtr <NetworkAdapter> mPeer;
     159    const ComObjPtr<Machine, ComWeakRef> mParent;
     160    const ComObjPtr<NetworkAdapter> mPeer;
    161161
    162162    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/ParallelPortImpl.h

    r21823 r21878  
    119119    HRESULT checkSetPath (CBSTR aPath);
    120120
    121     const ComObjPtr <Machine, ComWeakRef> mParent;
    122     const ComObjPtr <ParallelPort> mPeer;
     121    const ComObjPtr<Machine, ComWeakRef> mParent;
     122    const ComObjPtr<ParallelPort> mPeer;
    123123
    124124    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r21823 r21878  
    186186    void registerBaseMetric (pm::BaseMetric *baseMetric);
    187187    void registerMetric (pm::Metric *metric);
    188     void unregisterBaseMetricsFor (const ComPtr <IUnknown> &object);
    189     void unregisterMetricsFor (const ComPtr <IUnknown> &object);
     188    void unregisterBaseMetricsFor (const ComPtr<IUnknown> &object);
     189    void unregisterMetricsFor (const ComPtr<IUnknown> &object);
    190190
    191191    void suspendSampling();
  • trunk/src/VBox/Main/include/ProgressImpl.h

    r21823 r21878  
    9898#if !defined (VBOX_COM_INPROC)
    9999    /** Weak parent. */
    100     const ComObjPtr <VirtualBox, ComWeakRef> mParent;
    101 #endif
    102 
    103     const ComPtr <IUnknown> mInitiator;
     100    const ComObjPtr<VirtualBox, ComWeakRef> mParent;
     101#endif
     102
     103    const ComPtr<IUnknown> mInitiator;
    104104
    105105    const Guid mId;
     
    114114    BOOL mCanceled;
    115115    HRESULT mResultCode;
    116     ComPtr <IVirtualBoxErrorInfo> mErrorInfo;
     116    ComPtr<IVirtualBoxErrorInfo> mErrorInfo;
    117117
    118118    ULONG m_cOperations;                            // number of operations (so that progress dialog can display something like 1/3)
     
    416416    HRESULT checkProgress();
    417417
    418     typedef std::vector <ComPtr <IProgress> > ProgressVector;
     418    typedef std::vector <ComPtr<IProgress> > ProgressVector;
    419419    ProgressVector mProgresses;
    420420
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r21823 r21878  
    132132    HRESULT checkSetPath (CBSTR aPath);
    133133
    134     const ComObjPtr <Machine, ComWeakRef> mParent;
    135     const ComObjPtr <SerialPort> mPeer;
     134    const ComObjPtr<Machine, ComWeakRef> mParent;
     135    const ComObjPtr<SerialPort> mPeer;
    136136
    137137    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/SessionImpl.h

    r21823 r21878  
    125125    SessionType_T mType;
    126126
    127     ComPtr <IInternalMachineControl> mControl;
     127    ComPtr<IInternalMachineControl> mControl;
    128128
    129     ComObjPtr <Console> mConsole;
     129    ComObjPtr<Console> mConsole;
    130130
    131     ComPtr <IMachine> mRemoteMachine;
    132     ComPtr <IConsole> mRemoteConsole;
     131    ComPtr<IMachine> mRemoteMachine;
     132    ComPtr<IConsole> mRemoteConsole;
    133133
    134     ComPtr <IVirtualBox> mVirtualBox;
     134    ComPtr<IVirtualBox> mVirtualBox;
    135135
    136136    /* interprocess semaphore handle (id) for the opened machine */
  • trunk/src/VBox/Main/include/SharedFolderImpl.h

    r21823 r21878  
    104104
    105105    /* weak parents (only one of them is not null) */
    106     const ComObjPtr <Machine, ComWeakRef> mMachine;
    107     const ComObjPtr <Console, ComWeakRef> mConsole;
    108     const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     106    const ComObjPtr<Machine, ComWeakRef> mMachine;
     107    const ComObjPtr<Console, ComWeakRef> mConsole;
     108    const ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    109109
    110110    Data m;
  • trunk/src/VBox/Main/include/StorageControllerImpl.h

    r21823 r21878  
    142142
    143143    /** @note this doesn't require a read lock since mParent is constant. */
    144     const ComObjPtr <Machine, ComWeakRef> &parent() { return mParent; };
     144    const ComObjPtr<Machine, ComWeakRef> &parent() { return mParent; };
    145145
    146146    const Backupable<Data> &data() { return mData; }
    147     ComObjPtr <StorageController> peer() { return mPeer; }
     147    ComObjPtr<StorageController> peer() { return mPeer; }
    148148
    149149    // for VirtualBoxSupportErrorInfoImpl
     
    157157    const ComObjPtr<Machine, ComWeakRef> mParent;
    158158    /** Peer object. */
    159     const ComObjPtr <StorageController> mPeer;
     159    const ComObjPtr<StorageController> mPeer;
    160160    /** Data. */
    161161    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r21823 r21878  
    9898    HRESULT saveSettings (settings::Key &aGlobal);
    9999
    100     ComObjPtr <HardDiskFormat> hardDiskFormat (CBSTR aFormat);
     100    ComObjPtr<HardDiskFormat> hardDiskFormat (CBSTR aFormat);
    101101
    102102    // public methods for internal purposes only
     
    120120private:
    121121
    122     typedef std::list <ComObjPtr <HardDiskFormat> > HardDiskFormatList;
     122    typedef std::list <ComObjPtr<HardDiskFormat> > HardDiskFormatList;
    123123
    124124    HRESULT setDefaultMachineFolder (CBSTR aPath);
     
    129129    HRESULT setWebServiceAuthLibrary (CBSTR aPath);
    130130
    131     const ComObjPtr <VirtualBox, ComWeakRef> mParent;
     131    const ComObjPtr<VirtualBox, ComWeakRef> mParent;
    132132
    133133    Bstr mDefaultMachineFolder;
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r21823 r21878  
    122122                                  BOOL aActiveChanged = FALSE);
    123123
    124     bool hasMatchingFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
     124    bool hasMatchingFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    125125    bool hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
    126126
     
    132132
    133133    /** @note this doesn't require a read lock since mParent is constant. */
    134     const ComObjPtr <Machine, ComWeakRef> &parent() { return mParent; };
     134    const ComObjPtr<Machine, ComWeakRef> &parent() { return mParent; };
    135135
    136136    const Backupable<Data> &data() { return mData; }
     
    143143#ifdef VBOX_WITH_USB
    144144    /** specialization for IUSBDeviceFilter */
    145     ComObjPtr <USBDeviceFilter> getDependentChild (IUSBDeviceFilter *aFilter)
     145    ComObjPtr<USBDeviceFilter> getDependentChild (IUSBDeviceFilter *aFilter)
    146146    {
    147147        VirtualBoxBase *child = VirtualBoxBaseWithChildrenNEXT::
    148                                 getDependentChild (ComPtr <IUnknown> (aFilter));
     148                                getDependentChild (ComPtr<IUnknown> (aFilter));
    149149        return child ? static_cast <USBDeviceFilter *> (child)
    150150                     : NULL;
     
    157157    const ComObjPtr<Machine, ComWeakRef> mParent;
    158158    /** Peer object. */
    159     const ComObjPtr <USBController> mPeer;
     159    const ComObjPtr<USBController> mPeer;
    160160    /** Data. */
    161161    Backupable <Data> mData;
     
    165165    // so they cannot be a part of Data
    166166
    167     typedef std::list <ComObjPtr <USBDeviceFilter> > DeviceFilterList;
     167    typedef std::list <ComObjPtr<USBDeviceFilter> > DeviceFilterList;
    168168    Backupable <DeviceFilterList> mDeviceFilters;
    169169#endif /* VBOX_WITH_USB */
  • trunk/src/VBox/Main/include/VMMDev.h

    r14949 r21878  
    6565    static DECLCALLBACK(void)   drvReset(PPDMDRVINS pDrvIns);
    6666
    67     ComObjPtr <Console, ComWeakRef> mParent;
     67    ComObjPtr<Console, ComWeakRef> mParent;
    6868
    6969    RTSEMEVENT mCredentialsEvent;
  • trunk/src/VBox/Main/include/VRDPServerImpl.h

    r21823 r21878  
    126126private:
    127127
    128     const ComObjPtr <Machine, ComWeakRef> mParent;
    129     const ComObjPtr <VRDPServer> mPeer;
     128    const ComObjPtr<Machine, ComWeakRef> mParent;
     129    const ComObjPtr<VRDPServer> mPeer;
    130130
    131131    Backupable <Data> mData;
  • trunk/src/VBox/Main/include/VirtualBoxBase.h

    r21823 r21878  
    19421942        //  dead-locks any more).
    19431943        Assert (!child->isWriteLockOnCurrentThread() || child->lockHandle() == lockHandle());
    1944         removeDependentChild (ComPtr <IUnknown> (child));
     1944        removeDependentChild (ComPtr<IUnknown> (child));
    19451945    }
    19461946
     
    19491949    void uninitDependentChildren();
    19501950
    1951     VirtualBoxBase *getDependentChild (const ComPtr <IUnknown> &unk);
     1951    VirtualBoxBase *getDependentChild (const ComPtr<IUnknown> &unk);
    19521952
    19531953private:
    19541954
    1955     void addDependentChild (const ComPtr <IUnknown> &unk, VirtualBoxBase *child);
    1956     void removeDependentChild (const ComPtr <IUnknown> &unk);
     1955    void addDependentChild (const ComPtr<IUnknown> &unk, VirtualBoxBase *child);
     1956    void removeDependentChild (const ComPtr<IUnknown> &unk);
    19571957
    19581958    typedef std::map <IUnknown *, VirtualBoxBase *> DependentChildren;
     
    20682068    {
    20692069        AssertReturnVoid (aChild != NULL);
    2070         doAddDependentChild (ComPtr <IUnknown> (aChild), aChild);
     2070        doAddDependentChild (ComPtr<IUnknown> (aChild), aChild);
    20712071    }
    20722072
    20732073    /**
    20742074     * Equivalent to template <class C> void addDependentChild (C *aChild)
    2075      * but takes a ComObjPtr <C> argument.
     2075     * but takes a ComObjPtr<C> argument.
    20762076     */
    20772077    template <class C>
    2078     void addDependentChild (const ComObjPtr <C> &aChild)
     2078    void addDependentChild (const ComObjPtr<C> &aChild)
    20792079    {
    20802080        AssertReturnVoid (!aChild.isNull());
    2081         doAddDependentChild (ComPtr <IUnknown> (static_cast <C *> (aChild)), aChild);
     2081        doAddDependentChild (ComPtr<IUnknown> (static_cast <C *> (aChild)), aChild);
    20822082    }
    20832083
     
    21132113    {
    21142114        AssertReturnVoid (aChild != NULL);
    2115         doRemoveDependentChild (ComPtr <IUnknown> (aChild));
     2115        doRemoveDependentChild (ComPtr<IUnknown> (aChild));
    21162116    }
    21172117
    21182118    /**
    21192119     * Equivalent to template <class C> void removeDependentChild (C *aChild)
    2120      * but takes a ComObjPtr <C> argument.
     2120     * but takes a ComObjPtr<C> argument.
    21212121     */
    21222122    template <class C>
    2123     void removeDependentChild (const ComObjPtr <C> &aChild)
     2123    void removeDependentChild (const ComObjPtr<C> &aChild)
    21242124    {
    21252125        AssertReturnVoid (!aChild.isNull());
    2126         doRemoveDependentChild (ComPtr <IUnknown> (static_cast <C *> (aChild)));
     2126        doRemoveDependentChild (ComPtr<IUnknown> (static_cast <C *> (aChild)));
    21272127    }
    21282128
     
    21312131    void uninitDependentChildren();
    21322132
    2133     VirtualBoxBase *getDependentChild(const ComPtr <IUnknown> &aUnk);
     2133    VirtualBoxBase *getDependentChild(const ComPtr<IUnknown> &aUnk);
    21342134
    21352135private:
     
    21752175public:
    21762176
    2177     typedef std::list <ComObjPtr <C> > DependentChildren;
     2177    typedef std::list <ComObjPtr<C> > DependentChildren;
    21782178
    21792179    VirtualBoxBaseWithTypedChildren()
  • trunk/src/VBox/Main/include/VirtualBoxErrorInfoImpl.h

    r21783 r21878  
    9393    Guid mIID;
    9494    Bstr mComponent;
    95     ComPtr <IVirtualBoxErrorInfo> mNext;
     95    ComPtr<IVirtualBoxErrorInfo> mNext;
    9696};
    9797
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r21823 r21878  
    7474public:
    7575
    76     typedef std::list <ComPtr <IVirtualBoxCallback> > CallbackList;
    77     typedef std::vector <ComPtr <IVirtualBoxCallback> > CallbackVector;
    78 
    79     typedef std::vector <ComObjPtr <SessionMachine> > SessionMachineVector;
    80     typedef std::vector <ComObjPtr <Machine> > MachineVector;
    81 
    82     typedef std::vector <ComPtr <IInternalSessionControl> > InternalControlVector;
     76    typedef std::list <ComPtr<IVirtualBoxCallback> > CallbackList;
     77    typedef std::vector <ComPtr<IVirtualBoxCallback> > CallbackVector;
     78
     79    typedef std::vector <ComObjPtr<SessionMachine> > SessionMachineVector;
     80    typedef std::vector <ComObjPtr<Machine> > MachineVector;
     81
     82    typedef std::vector <ComPtr<IInternalSessionControl> > InternalControlVector;
    8383
    8484    class CallbackEvent;
     
    224224                                IN_BSTR aFlags);
    225225
    226     ComObjPtr <GuestOSType> getUnknownOSType();
     226    ComObjPtr<GuestOSType> getUnknownOSType();
    227227
    228228    void getOpenedMachines (SessionMachineVector &aMachines,
     
    240240
    241241    HRESULT findMachine (const Guid &aId, bool aSetError,
    242                          ComObjPtr <Machine> *machine = NULL);
     242                         ComObjPtr<Machine> *machine = NULL);
    243243
    244244    HRESULT findHardDisk(const Guid *aId, CBSTR aLocation,
     
    249249                            bool aSetError, ComObjPtr<FloppyImage> *aImage = NULL);
    250250
    251     const ComObjPtr <Host> &host() { return mData.mHost; }
    252     const ComObjPtr <SystemProperties> &systemProperties()
     251    const ComObjPtr<Host> &host() { return mData.mHost; }
     252    const ComObjPtr<SystemProperties> &systemProperties()
    253253        { return mData.mSystemProperties; }
    254254#ifdef VBOX_WITH_RESOURCE_USAGE_API
    255     const ComObjPtr <PerformanceCollector> &performanceCollector()
     255    const ComObjPtr<PerformanceCollector> &performanceCollector()
    256256        { return mData.mPerformanceCollector; }
    257257#endif /* VBOX_WITH_RESOURCE_USAGE_API */
     
    364364private:
    365365
    366     typedef std::list <ComObjPtr <Machine> > MachineList;
    367     typedef std::list <ComObjPtr <GuestOSType> > GuestOSTypeList;
    368 
    369     typedef std::map <Guid, ComPtr <IProgress> > ProgressMap;
    370 
    371     typedef std::list <ComObjPtr <HardDisk> > HardDiskList;
    372     typedef std::list <ComObjPtr <DVDImage> > DVDImageList;
    373     typedef std::list <ComObjPtr <FloppyImage> > FloppyImageList;
    374     typedef std::list <ComObjPtr <SharedFolder> > SharedFolderList;
    375     typedef std::list <ComObjPtr <DHCPServer> > DHCPServerList;
     366    typedef std::list <ComObjPtr<Machine> > MachineList;
     367    typedef std::list <ComObjPtr<GuestOSType> > GuestOSTypeList;
     368
     369    typedef std::map <Guid, ComPtr<IProgress> > ProgressMap;
     370
     371    typedef std::list <ComObjPtr<HardDisk> > HardDiskList;
     372    typedef std::list <ComObjPtr<DVDImage> > DVDImageList;
     373    typedef std::list <ComObjPtr<FloppyImage> > FloppyImageList;
     374    typedef std::list <ComObjPtr<SharedFolder> > SharedFolderList;
     375    typedef std::list <ComObjPtr<DHCPServer> > DHCPServerList;
    376376
    377377    typedef std::map <Guid, ComObjPtr<HardDisk> > HardDiskMap;
     
    430430
    431431        // const objects not requiring locking
    432         const ComObjPtr <Host> mHost;
    433         const ComObjPtr <SystemProperties> mSystemProperties;
     432        const ComObjPtr<Host> mHost;
     433        const ComObjPtr<SystemProperties> mSystemProperties;
    434434#ifdef VBOX_WITH_RESOURCE_USAGE_API
    435         const ComObjPtr <PerformanceCollector> mPerformanceCollector;
     435        const ComObjPtr<PerformanceCollector> mPerformanceCollector;
    436436#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    437437
     
    544544    void *handler();
    545545
    546     virtual void handleCallback (const ComPtr <IVirtualBoxCallback> &aCallback) = 0;
     546    virtual void handleCallback (const ComPtr<IVirtualBoxCallback> &aCallback) = 0;
    547547
    548548private:
     
    552552     *  is bound to the lifetime of the VirtualBox instance, so it's safe.
    553553     */
    554     ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
     554    ComObjPtr<VirtualBox, ComWeakRef> mVirtualBox;
    555555};
    556556
  • trunk/src/VBox/Main/include/netif.h

    r19433 r21878  
    7979#endif
    8080
    81 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list);
     81int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list);
    8282int NetIfEnableStaticIpConfig(VirtualBox *pVbox, HostNetworkInterface * pIf, ULONG aOldIp, ULONG aNewIp, ULONG aMask);
    8383int NetIfEnableStaticIpConfigV6(VirtualBox *pVbox, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength);
  • trunk/src/VBox/Main/linux/HostHardwareLinux.cpp

    r21713 r21878  
    118118int VBoxMainDriveInfo::updateDVDs ()
    119119{
    120     LogFlowThisFunc (("entered\n"));
     120    LogFlowThisFunc(("entered\n"));
    121121    int rc = VINF_SUCCESS;
    122122    bool success = false;  /* Have we succeeded in finding anything yet? */
     
    127127        /* Always allow the user to override our auto-detection using an
    128128         * environment variable. */
    129         if (RT_SUCCESS (rc) && (!success || testing()))
     129        if (RT_SUCCESS(rc) && (!success || testing()))
    130130            rc = getDriveInfoFromEnv ("VBOX_CDROM", &mDVDList, true /* isDVD */,
    131131                                      &success);
    132132#ifdef VBOX_WITH_DBUS
    133         if (RT_SUCCESS (rc) && RT_SUCCESS(VBoxLoadDBusLib()) && (!success || testing()))
     133        if (RT_SUCCESS(rc) && RT_SUCCESS(VBoxLoadDBusLib()) && (!success || testing()))
    134134            rc = getDriveInfoFromHal(&mDVDList, true /* isDVD */, &success);
    135135#endif /* VBOX_WITH_DBUS defined */
     
    139139         * enumerate the /etc/fstab file (luckily there's an API to parse it)
    140140         * for CDROM devices. Ok, let's start! */
    141         if (RT_SUCCESS (rc) && (!success || testing()))
     141        if (RT_SUCCESS(rc) && (!success || testing()))
    142142        {
    143143            // this is a good guess usually
     
    149149
    150150            // check the drives that can be mounted
    151             if (RT_SUCCESS (rc))
     151            if (RT_SUCCESS(rc))
    152152                rc = getDVDInfoFromMTab((char*)"/etc/fstab", &mDVDList);
    153153        }
     
    158158        rc = VERR_NO_MEMORY;
    159159    }
    160     LogFlowThisFunc (("rc=%Rrc\n", rc));
     160    LogFlowThisFunc(("rc=%Rrc\n", rc));
    161161    return rc;
    162162}
     
    164164int VBoxMainDriveInfo::updateFloppies ()
    165165{
    166     LogFlowThisFunc (("entered\n"));
     166    LogFlowThisFunc(("entered\n"));
    167167    int rc = VINF_SUCCESS;
    168168    bool success = false;  /* Have we succeeded in finding anything yet? */
     
    171171        mFloppyList.clear ();
    172172#if defined(RT_OS_LINUX)
    173         if (RT_SUCCESS (rc) && (!success || testing()))
     173        if (RT_SUCCESS(rc) && (!success || testing()))
    174174            rc = getDriveInfoFromEnv ("VBOX_FLOPPY", &mFloppyList, false /* isDVD */,
    175175                                      &success);
    176176#ifdef VBOX_WITH_DBUS
    177         if (   RT_SUCCESS (rc)
     177        if (   RT_SUCCESS(rc)
    178178            && RT_SUCCESS(VBoxLoadDBusLib())
    179179            && (!success || testing()))
     
    185185         * environment variable, skiping the detection. */
    186186
    187         if (RT_SUCCESS (rc) && (!success || testing()))
     187        if (RT_SUCCESS(rc) && (!success || testing()))
    188188        {
    189189            // we assume that a floppy is always /dev/fd[x] with x from 0 to 7
     
    202202        rc = VERR_NO_MEMORY;
    203203    }
    204     LogFlowThisFunc (("rc=%Rrc\n", rc));
     204    LogFlowThisFunc(("rc=%Rrc\n", rc));
    205205    return rc;
    206206}
     
    208208int VBoxMainUSBDeviceInfo::UpdateDevices ()
    209209{
    210     LogFlowThisFunc (("entered\n"));
     210    LogFlowThisFunc(("entered\n"));
    211211    int rc = VINF_SUCCESS;
    212212    bool success = false;  /* Have we succeeded in finding anything yet? */
     
    217217#if defined(RT_OS_LINUX)
    218218#ifdef VBOX_WITH_DBUS
    219         if (   RT_SUCCESS (rc)
     219        if (   RT_SUCCESS(rc)
    220220            && RT_SUCCESS(VBoxLoadDBusLib())
    221221            && (!success || testing()))
     
    223223        /* Try the old API if the new one *succeeded* as only one of them will
    224224         * pick up devices anyway. */
    225         if (RT_SUCCESS (rc) && halSuccess && (!success || testing()))
     225        if (RT_SUCCESS(rc) && halSuccess && (!success || testing()))
    226226            rc = getOldUSBDeviceInfoFromHal(&mDeviceList, &halSuccess);
    227227        if (!success)
     
    234234        rc = VERR_NO_MEMORY;
    235235    }
    236     LogFlowThisFunc (("rc=%Rrc\n", rc));
     236    LogFlowThisFunc(("rc=%Rrc\n", rc));
    237237    return rc;
    238238}
     
    272272            rc = VERR_NOT_SUPPORTED;
    273273        DBusMessage *pMessage;
    274         while (   RT_SUCCESS (rc)
     274        while (   RT_SUCCESS(rc)
    275275               && (pMessage = dbus_connection_pop_message (mContext->mConnection.get())) != NULL)
    276276            dbus_message_unref (pMessage); /* empty the message queue. */
    277         if (   RT_SUCCESS (rc)
     277        if (   RT_SUCCESS(rc)
    278278            && !dbus_connection_add_filter (mContext->mConnection.get(),
    279279                                            dbusFilterFunction,
    280280                                            (void *) &mContext->mTriggered, NULL))
    281281            rc = VERR_NO_MEMORY;
    282         if (RT_FAILURE (rc))
     282        if (RT_FAILURE(rc))
    283283            mContext->mConnection.reset();
    284284    }
     
    314314    else
    315315        cRealMillies = DBUS_POLL_TIMEOUT;
    316     while (   RT_SUCCESS (rc) && connected && !mContext->mTriggered
     316    while (   RT_SUCCESS(rc) && connected && !mContext->mTriggered
    317317           && !mContext->mInterrupt)
    318318    {
     
    439439                rc = VERR_NO_MEMORY;
    440440        }
    441         if (pszValue != NULL && RT_SUCCESS (rc))
     441        if (pszValue != NULL && RT_SUCCESS(rc))
    442442        {
    443443            char *pDrive = drive.get();
     
    492492            RTMemAutoPtr <char, RTStrFree> mnt_type, mnt_dev;
    493493            char *tmp;
    494             while (RT_SUCCESS (rc) && (mntent = getmntent(mtab)))
     494            while (RT_SUCCESS(rc) && (mntent = getmntent(mtab)))
    495495            {
    496496                mnt_type = RTStrDup (mntent->mnt_type);
     
    499499                    rc = VERR_NO_MEMORY;
    500500                // supermount fs case
    501                 if (RT_SUCCESS (rc) && strcmp(mnt_type.get(), "supermount") == 0)
     501                if (RT_SUCCESS(rc) && strcmp(mnt_type.get(), "supermount") == 0)
    502502                {
    503503                    tmp = strstr(mntent->mnt_opts, "fs=");
     
    529529                }
    530530                // use strstr here to cover things fs types like "udf,iso9660"
    531                 if (RT_SUCCESS (rc) && strstr(mnt_type.get(), "iso9660") == 0)
     531                if (RT_SUCCESS(rc) && strstr(mnt_type.get(), "iso9660") == 0)
    532532                {
    533533                    if (validateDevice(mnt_dev.get(), true))
     
    785785
    786786    RTMemAutoPtr <DBusMessage, VBoxDBusMessageUnref> message, reply;
    787     if (halSuccess && RT_SUCCESS (rc))
     787    if (halSuccess && RT_SUCCESS(rc))
    788788    {
    789789        message = dbus_message_new_method_call ("org.freedesktop.Hal",
     
    794794            rc = VERR_NO_MEMORY;
    795795    }
    796     if (halSuccess && RT_SUCCESS (rc))
     796    if (halSuccess && RT_SUCCESS(rc))
    797797    {
    798798        DBusMessageIter iterAppend;
     
    834834    AssertPtrReturn (pszValue, VERR_INVALID_POINTER);
    835835    AssertPtrReturn (pMatches, VERR_INVALID_POINTER);
    836     AssertReturn (pfSuccess == NULL || VALID_PTR (pfSuccess), VERR_INVALID_POINTER);
     836    AssertReturn(pfSuccess == NULL || VALID_PTR (pfSuccess), VERR_INVALID_POINTER);
    837837    LogFlowFunc (("pConnection=%p, pszKey=%s, pszValue=%s, pMatches=%p, pfSuccess=%p\n",
    838838                  pConnection, pszKey, pszValue, pMatches, pfSuccess));
     
    843843    DBusMessageIter iterFind, iterUdis;
    844844
    845     if (halSuccess && RT_SUCCESS (rc))
     845    if (halSuccess && RT_SUCCESS(rc))
    846846    {
    847847        rc = halFindDeviceStringMatch (pConnection, pszKey, pszValue,
     
    850850            halSuccess = false;
    851851    }
    852     if (halSuccess && RT_SUCCESS (rc))
     852    if (halSuccess && RT_SUCCESS(rc))
    853853    {
    854854        dbus_message_iter_init (replyFind.get(), &iterFind);
     
    856856            halSuccess = false;
    857857    }
    858     if (halSuccess && RT_SUCCESS (rc))
     858    if (halSuccess && RT_SUCCESS(rc))
    859859        dbus_message_iter_recurse (&iterFind, &iterUdis);
    860     for (;    halSuccess && RT_SUCCESS (rc)
     860    for (;    halSuccess && RT_SUCCESS(rc)
    861861           && dbus_message_iter_get_arg_type (&iterUdis) == DBUS_TYPE_STRING;
    862862         dbus_message_iter_next(&iterUdis))
     
    928928    if (!message)
    929929        rc = VERR_NO_MEMORY;
    930     if (halSuccess && RT_SUCCESS (rc))
     930    if (halSuccess && RT_SUCCESS(rc))
    931931    {
    932932        reply = dbus_connection_send_with_reply_and_block (pConnection,
     
    938938
    939939    /* Parse the reply */
    940     if (halSuccess && RT_SUCCESS (rc))
     940    if (halSuccess && RT_SUCCESS(rc))
    941941    {
    942942        dbus_message_iter_init (reply.get(), &iterGet);
     
    945945            halSuccess = false;
    946946    }
    947     if (halSuccess && RT_SUCCESS (rc))
     947    if (halSuccess && RT_SUCCESS(rc))
    948948        dbus_message_iter_recurse (&iterGet, &iterProps);
    949949    /* Go through all entries in the reply and see if any match our keys. */
    950     while (   halSuccess && RT_SUCCESS (rc)
     950    while (   halSuccess && RT_SUCCESS(rc)
    951951           &&    dbus_message_iter_get_arg_type (&iterProps)
    952952              == DBUS_TYPE_DICT_ENTRY)
     
    967967        dbus_message_iter_next (&iterProps);
    968968    }
    969     if (RT_SUCCESS (rc) && halSuccess)
     969    if (RT_SUCCESS(rc) && halSuccess)
    970970        *pMessage = reply.release();
    971971    if (dbusError.HasName (DBUS_ERROR_NO_MEMORY))
     
    10041004    AssertPtrReturn (papszKeys, VERR_INVALID_POINTER);
    10051005    AssertPtrReturn (pMatches, VERR_INVALID_POINTER);
    1006     AssertReturn ((pfMatches == NULL) || VALID_PTR (pfMatches), VERR_INVALID_POINTER);
    1007     AssertReturn ((pfSuccess == NULL) || VALID_PTR (pfSuccess), VERR_INVALID_POINTER);
     1006    AssertReturn((pfMatches == NULL) || VALID_PTR (pfMatches), VERR_INVALID_POINTER);
     1007    AssertReturn((pfSuccess == NULL) || VALID_PTR (pfSuccess), VERR_INVALID_POINTER);
    10081008    AssertReturn(pMatches->empty(), VERR_INVALID_PARAMETER);
    10091009    LogFlowFunc (("pConnection=%p, pszUdi=%s, cProps=%llu, papszKeys=%p, pMatches=%p, pfMatches=%p, pfSuccess=%p\n",
     
    10751075        if (!dbusConnection)
    10761076            halSuccess = false;
    1077         if (halSuccess && RT_SUCCESS (rc))
     1077        if (halSuccess && RT_SUCCESS(rc))
    10781078        {
    10791079            rc = halFindDeviceStringMatch (dbusConnection.get(), "storage.drive_type",
     
    10821082                halSuccess = false;
    10831083        }
    1084         if (halSuccess && RT_SUCCESS (rc))
     1084        if (halSuccess && RT_SUCCESS(rc))
    10851085        {
    10861086            dbus_message_iter_init (replyFind.get(), &iterFind);
     
    10881088                halSuccess = false;
    10891089        }
    1090         if (halSuccess && RT_SUCCESS (rc))
     1090        if (halSuccess && RT_SUCCESS(rc))
    10911091            dbus_message_iter_recurse (&iterFind, &iterUdis);
    1092         for (;    halSuccess && RT_SUCCESS (rc)
     1092        for (;    halSuccess && RT_SUCCESS(rc)
    10931093            && dbus_message_iter_get_arg_type (&iterUdis) == DBUS_TYPE_STRING;
    10941094            dbus_message_iter_next(&iterUdis))
     
    11661166        halSuccess = false;
    11671167    /* Get an array of all devices in the usb_device subsystem */
    1168     if (halSuccess && RT_SUCCESS (rc))
     1168    if (halSuccess && RT_SUCCESS(rc))
    11691169    {
    11701170        rc = halFindDeviceStringMatch (dbusConnection.get(), "info.subsystem",
     
    11731173            halSuccess = false;
    11741174    }
    1175     if (halSuccess && RT_SUCCESS (rc))
     1175    if (halSuccess && RT_SUCCESS(rc))
    11761176    {
    11771177        dbus_message_iter_init (replyFind.get(), &iterFind);
     
    11811181    /* Recurse down into the array and query interesting information about the
    11821182     * entries. */
    1183     if (halSuccess && RT_SUCCESS (rc))
     1183    if (halSuccess && RT_SUCCESS(rc))
    11841184        dbus_message_iter_recurse (&iterFind, &iterUdis);
    1185     for (;    halSuccess && RT_SUCCESS (rc)
     1185    for (;    halSuccess && RT_SUCCESS(rc)
    11861186           && dbus_message_iter_get_arg_type (&iterUdis) == DBUS_TYPE_STRING;
    11871187         dbus_message_iter_next(&iterUdis))
     
    12511251        halSuccess = false;
    12521252    /* Get an array of all devices in the usb_device subsystem */
    1253     if (halSuccess && RT_SUCCESS (rc))
     1253    if (halSuccess && RT_SUCCESS(rc))
    12541254    {
    12551255        rc = halFindDeviceStringMatch (dbusConnection.get(), "info.category",
     
    12581258            halSuccess = false;
    12591259    }
    1260     if (halSuccess && RT_SUCCESS (rc))
     1260    if (halSuccess && RT_SUCCESS(rc))
    12611261    {
    12621262        dbus_message_iter_init (replyFind.get(), &iterFind);
     
    12661266    /* Recurse down into the array and query interesting information about the
    12671267     * entries. */
    1268     if (halSuccess && RT_SUCCESS (rc))
     1268    if (halSuccess && RT_SUCCESS(rc))
    12691269        dbus_message_iter_recurse (&iterFind, &iterUdis);
    1270     for (;    halSuccess && RT_SUCCESS (rc)
     1270    for (;    halSuccess && RT_SUCCESS(rc)
    12711271           && dbus_message_iter_get_arg_type (&iterUdis) == DBUS_TYPE_STRING;
    12721272         dbus_message_iter_next(&iterUdis))
     
    13411341    if (!dbusConnection)
    13421342        halSuccess = false;
    1343     if (halSuccess && RT_SUCCESS (rc))
     1343    if (halSuccess && RT_SUCCESS(rc))
    13441344    {
    13451345        /* Look for children of the current UDI. */
     
    13491349            halSuccess = false;
    13501350    }
    1351     if (halSuccess && RT_SUCCESS (rc))
     1351    if (halSuccess && RT_SUCCESS(rc))
    13521352    {
    13531353        dbus_message_iter_init (replyFind.get(), &iterFind);
     
    13551355            halSuccess = false;
    13561356    }
    1357     if (halSuccess && RT_SUCCESS (rc))
     1357    if (halSuccess && RT_SUCCESS(rc))
    13581358        dbus_message_iter_recurse (&iterFind, &iterUdis);
    1359     for (;    halSuccess && RT_SUCCESS (rc)
     1359    for (;    halSuccess && RT_SUCCESS(rc)
    13601360           && dbus_message_iter_get_arg_type (&iterUdis) == DBUS_TYPE_STRING;
    13611361         dbus_message_iter_next(&iterUdis))
     
    13751375        if (!!replyGet && pszSysfsPath == NULL)
    13761376            halSuccess = false;
    1377         if (   halSuccess && RT_SUCCESS (rc)
     1377        if (   halSuccess && RT_SUCCESS(rc)
    13781378            && RTStrCmp (pszInfoSubsystem, "usb_device") != 0  /* Children of buses can also be devices. */
    13791379            && RTStrCmp (pszLinuxSubsystem, "usb_device") != 0)
  • trunk/src/VBox/Main/linux/NetIf-linux.cpp

    r20481 r21878  
    151151}
    152152
    153 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     153int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    154154{
    155155    char szDefaultIface[256];
  • trunk/src/VBox/Main/os2/NetIf-os2.cpp

    r18732 r21878  
    3333#include "netif.h"
    3434
    35 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     35int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    3636{
    3737    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/Main/solaris/NetIf-solaris.cpp

    r19433 r21878  
    5959static void vboxSolarisAddHostIface(char *pszIface, int Instance, void *pvHostNetworkInterfaceList)
    6060{
    61     std::list<ComObjPtr <HostNetworkInterface> > *pList = (std::list<ComObjPtr <HostNetworkInterface> > *)pvHostNetworkInterfaceList;
     61    std::list<ComObjPtr<HostNetworkInterface> > *pList = (std::list<ComObjPtr<HostNetworkInterface> > *)pvHostNetworkInterfaceList;
    6262    Assert(pList);
    6363
     
    244244}
    245245
    246 static bool vboxSolarisSortNICList(const ComObjPtr <HostNetworkInterface> Iface1, const ComObjPtr <HostNetworkInterface> Iface2)
     246static bool vboxSolarisSortNICList(const ComObjPtr<HostNetworkInterface> Iface1, const ComObjPtr<HostNetworkInterface> Iface2)
    247247{
    248248    Bstr Iface1Str;
     
    255255}
    256256
    257 static bool vboxSolarisSameNIC(const ComObjPtr <HostNetworkInterface> Iface1, const ComObjPtr <HostNetworkInterface> Iface2)
     257static bool vboxSolarisSameNIC(const ComObjPtr<HostNetworkInterface> Iface1, const ComObjPtr<HostNetworkInterface> Iface2)
    258258{
    259259    Bstr Iface1Str;
     
    286286# endif /* VBOX_SOLARIS_NSL_RESOLVED */
    287287
    288 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     288int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    289289{
    290290
     
    388388
    389389#else
    390 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     390int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    391391{
    392392    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r20977 r21878  
    5353                                  ComPtr<IUnknown> aObject);
    5454static void queryMetrics (ComPtr<IVirtualBox> aVirtualBox,
    55                           ComPtr <IPerformanceCollector> collector,
     55                          ComPtr<IPerformanceCollector> collector,
    5656                          ComSafeArrayIn (IUnknown *, objects));
    5757static void listAffectedMetrics(ComPtr<IVirtualBox> aVirtualBox,
     
    7373    Bstr guid;
    7474    CHECK_ERROR (machine, COMGETTER(Id) (guid.asOutParam()));
    75     if (SUCCEEDED (rc) && !guid.isEmpty()) {
     75    if (SUCCEEDED(rc) && !guid.isEmpty()) {
    7676        RTPrintf ("Guid::toString(): {%s}\n", Utf8Str(guid).c_str());
    7777    } else {
     
    9292    RTPrintf ("Are any settings modified?...\n");
    9393    CHECK_ERROR (machine, COMGETTER(SettingsModified) (&modified));
    94     if (SUCCEEDED (rc))
     94    if (SUCCEEDED(rc))
    9595        RTPrintf ("%s\n", modified ? "yes" : "no");
    9696
     
    9999    CHECK_ERROR (machine, COMSETTER(MemorySize) (memorySizeBig));
    100100
    101     if (SUCCEEDED (rc))
     101    if (SUCCEEDED(rc))
    102102    {
    103103        RTPrintf ("Are any settings modified now?...\n");
     
    149149    RTPrintf ("Saving machine settings...\n");
    150150    CHECK_ERROR (machine, SaveSettings());
    151     if (SUCCEEDED (rc))
     151    if (SUCCEEDED(rc))
    152152    {
    153153        RTPrintf ("Are any settings modified after saving?...\n");
     
    185185    CHECK_ERROR (machine, SetExtraData (extraDataKey, extraData));
    186186
    187     if (SUCCEEDED (rc)) {
     187    if (SUCCEEDED(rc)) {
    188188        RTPrintf ("Getting extra data key {%ls} again...\n", extraDataKey.raw());
    189189        CHECK_ERROR_RET (machine, GetExtraData (extraDataKey, extraData.asOutParam()), rc);
     
    231231    ////////////////////////////////////////////////////////////////////////////
    232232
    233     ComPtr <IVirtualBox> virtualBox;
    234     ComPtr <ISession> session;
     233    ComPtr<IVirtualBox> virtualBox;
     234    ComPtr<ISession> session;
    235235
    236236#if 0
     
    284284
    285285        for (;;) {
    286             com::SafeIfaceArray <IProgress> operations;
     286            com::SafeIfaceArray<IProgress> operations;
    287287
    288288            CHECK_ERROR_BREAK (virtualBox,
     
    309309    {
    310310        {
    311             ComPtr <IVirtualBox> virtualBox2;
     311            ComPtr<IVirtualBox> virtualBox2;
    312312
    313313            RTPrintf ("Creating one more VirtualBox object...\n");
     
    323323            Assert ((IVirtualBox *) virtualBox == (IVirtualBox *) virtualBox2);
    324324
    325             ComPtr <IUnknown> unk (virtualBox);
    326             ComPtr <IUnknown> unk2;
     325            ComPtr<IUnknown> unk (virtualBox);
     326            ComPtr<IUnknown> unk2;
    327327            unk2 = virtualBox2;
    328328
     
    331331            Assert ((IUnknown *) unk == (IUnknown *) unk2);
    332332
    333             ComPtr <IVirtualBox> vb = unk;
    334             ComPtr <IVirtualBox> vb2 = unk;
     333            ComPtr<IVirtualBox> vb = unk;
     334            ComPtr<IVirtualBox> vb2 = unk;
    335335
    336336            RTPrintf ("IVirtualBox(IUnknown(virtualBox))=%p IVirtualBox(IUnknown(virtualBox2))=%p\n",
     
    340340
    341341        {
    342             ComPtr <IHost> host;
     342            ComPtr<IHost> host;
    343343            CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host)(host.asOutParam()));
    344344            RTPrintf (" IHost(host)=%p\n", (IHost *) host);
    345             ComPtr <IUnknown> unk = host;
     345            ComPtr<IUnknown> unk = host;
    346346            RTPrintf (" IUnknown(host)=%p\n", (IUnknown *) unk);
    347             ComPtr <IHost> host_copy = unk;
     347            ComPtr<IHost> host_copy = unk;
    348348            RTPrintf (" IHost(host_copy)=%p\n", (IHost *) host_copy);
    349             ComPtr <IUnknown> unk_copy = host_copy;
     349            ComPtr<IUnknown> unk_copy = host_copy;
    350350            RTPrintf (" IUnknown(host_copy)=%p\n", (IUnknown *) unk_copy);
    351351            Assert ((IUnknown *) unk == (IUnknown *) unk_copy);
    352352
    353353            /* query IUnknown on IUnknown */
    354             ComPtr <IUnknown> unk_copy_copy;
    355             unk_copy.queryInterfaceTo (unk_copy_copy.asOutParam());
     354            ComPtr<IUnknown> unk_copy_copy;
     355            unk_copy.queryInterfaceTo(unk_copy_copy.asOutParam());
    356356            RTPrintf (" IUnknown(unk_copy)=%p\n", (IUnknown *) unk_copy_copy);
    357357            Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy);
    358358            /* query IUnknown on IUnknown in the opposite direction */
    359             unk_copy_copy.queryInterfaceTo (unk_copy.asOutParam());
     359            unk_copy_copy.queryInterfaceTo(unk_copy.asOutParam());
    360360            RTPrintf (" IUnknown(unk_copy_copy)=%p\n", (IUnknown *) unk_copy);
    361361            Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy);
     
    398398        RTPrintf ("Calling IVirtualBox::Machines...\n");
    399399
    400         com::SafeIfaceArray <IMachine> machines;
     400        com::SafeIfaceArray<IMachine> machines;
    401401        CHECK_ERROR_BREAK (virtualBox,
    402402                           COMGETTER(Machines) (ComSafeArrayAsOutParam (machines)));
     
    516516        // call a method that will definitely fail
    517517        Guid uuid;
    518         ComPtr <IHardDisk> hardDisk;
     518        ComPtr<IHardDisk> hardDisk;
    519519        rc = virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    520520        RTPrintf ("virtualBox->GetHardDisk(null-uuid)=%08X\n", rc);
     
    538538
    539539        // call a method that will definitely fail
    540         ComPtr <IMachine> machine;
     540        ComPtr<IMachine> machine;
    541541        rc = session->COMGETTER(Machine)(machine.asOutParam());
    542542        RTPrintf ("session->COMGETTER(Machine)=%08X\n", rc);
     
    564564    do
    565565    {
    566         ComPtr <IHardDisk> hd;
     566        ComPtr<IHardDisk> hd;
    567567        Bstr src = L"E:\\develop\\innotek\\images\\NewHardDisk.vdi";
    568568        RTPrintf ("Opening the existing hard disk '%ls'...\n", src.raw());
     
    584584    do
    585585    {
    586         ComPtr <IVirtualDiskImage> vdi;
     586        ComPtr<IVirtualDiskImage> vdi;
    587587        Bstr src = L"CreatorTest.vdi";
    588588        RTPrintf ("Unregistering the hard disk '%ls'...\n", src.raw());
    589589        CHECK_ERROR_BREAK (virtualBox, FindVirtualDiskImage (src, vdi.asOutParam()));
    590         ComPtr <IHardDisk> hd = vdi;
     590        ComPtr<IHardDisk> hd = vdi;
    591591        Guid id;
    592592        CHECK_ERROR_BREAK (hd, COMGETTER(Id) (id.asOutParam()));
     
    609609        Bstr dst = L"./clone.vdi";
    610610        RTPrintf ("Cloning '%ls' to '%ls'...\n", src.raw(), dst.raw());
    611         ComPtr <IVirtualDiskImage> vdi;
     611        ComPtr<IVirtualDiskImage> vdi;
    612612        CHECK_ERROR_BREAK (virtualBox, FindVirtualDiskImage (src, vdi.asOutParam()));
    613         ComPtr <IHardDisk> hd = vdi;
    614         ComPtr <IProgress> progress;
     613        ComPtr<IHardDisk> hd = vdi;
     614        ComPtr<IProgress> progress;
    615615        CHECK_ERROR_BREAK (hd, CloneToImage (dst, vdi.asOutParam(), progress.asOutParam()));
    616616        RTPrintf ("Waiting for completion...\n");
     
    636636    do
    637637    {
    638         ComPtr <IHardDisk> hd;
     638        ComPtr<IHardDisk> hd;
    639639        static const wchar_t *Names[] =
    640640        {
     
    657657            RTPrintf ("Searching for hard disk '%ls'...\n", src.raw());
    658658            rc = virtualBox->FindHardDisk (src, hd.asOutParam());
    659             if (SUCCEEDED (rc))
     659            if (SUCCEEDED(rc))
    660660            {
    661661                Guid id;
     
    666666                        id.raw(), location.raw());
    667667
    668                 com::SafeArray <BSTR> names;
    669                 com::SafeArray <BSTR> values;
     668                com::SafeArray<BSTR> names;
     669                com::SafeArray<BSTR> values;
    670670
    671671                CHECK_ERROR_BREAK (hd, GetProperties (NULL,
     
    705705    do
    706706    {
    707         ComPtr <IMachine> machine;
     707        ComPtr<IMachine> machine;
    708708        Bstr name = argc > 1 ? argv [1] : "dos";
    709709        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
     
    732732    do
    733733    {
    734         ComPtr <IMachine> machine;
     734        ComPtr<IMachine> machine;
    735735#if defined (RT_OS_LINUX)
    736736        Bstr baseDir = L"/tmp/vbox";
     
    767767        CHECK_ERROR_BREAK (machine, COMSETTER(Description) (desc));
    768768
    769         ComPtr <IGuestOSType> guestOSType;
     769        ComPtr<IGuestOSType> guestOSType;
    770770        Bstr type = L"os2warp45";
    771771        CHECK_ERROR_BREAK (virtualBox, GetGuestOSType (type, guestOSType.asOutParam()));
     
    786786    do
    787787    {
    788         ComPtr <IHost> host;
     788        ComPtr<IHost> host;
    789789        CHECK_RC_BREAK (virtualBox->COMGETTER(Host) (host.asOutParam()));
    790790
    791791        {
    792             ComPtr <IHostDVDDriveCollection> coll;
     792            ComPtr<IHostDVDDriveCollection> coll;
    793793            CHECK_RC_BREAK (host->COMGETTER(DVDDrives) (coll.asOutParam()));
    794             ComPtr <IHostDVDDriveEnumerator> enumerator;
     794            ComPtr<IHostDVDDriveEnumerator> enumerator;
    795795            CHECK_RC_BREAK (coll->Enumerate (enumerator.asOutParam()));
    796796            BOOL hasmore;
    797             while (SUCCEEDED (enumerator->HasMore (&hasmore)) && hasmore)
     797            while (SUCCEEDED(enumerator->HasMore (&hasmore)) && hasmore)
    798798            {
    799                 ComPtr <IHostDVDDrive> drive;
     799                ComPtr<IHostDVDDrive> drive;
    800800                CHECK_RC_BREAK (enumerator->GetNext (drive.asOutParam()));
    801801                Bstr name;
     
    805805            CHECK_RC_BREAK (rc);
    806806
    807             ComPtr <IHostDVDDrive> drive;
     807            ComPtr<IHostDVDDrive> drive;
    808808            CHECK_ERROR (enumerator, GetNext (drive.asOutParam()));
    809809            CHECK_ERROR (coll, GetItemAt (1000, drive.asOutParam()));
    810810            CHECK_ERROR (coll, FindByName (Bstr ("R:"), drive.asOutParam()));
    811             if (SUCCEEDED (rc))
     811            if (SUCCEEDED(rc))
    812812            {
    813813                Bstr name;
     
    829829        CHECK_ERROR_BREAK (virtualBox,
    830830                           COMGETTER(SystemProperties) (systemProperties.asOutParam()));
    831         com::SafeIfaceArray <IHardDiskFormat> hardDiskFormats;
     831        com::SafeIfaceArray<IHardDiskFormat> hardDiskFormats;
    832832        CHECK_ERROR_BREAK (systemProperties,
    833833                           COMGETTER(HardDiskFormats) (ComSafeArrayAsOutParam (hardDiskFormats)));
     
    852852
    853853            /* File extensions */
    854             com::SafeArray <BSTR> fileExtensions;
     854            com::SafeArray<BSTR> fileExtensions;
    855855            CHECK_ERROR_BREAK (hardDiskFormats [i],
    856856                               COMGETTER(FileExtensions) (ComSafeArrayAsOutParam (fileExtensions)));
     
    864864
    865865            /* Configuration keys */
    866             com::SafeArray <BSTR> propertyNames;
    867             com::SafeArray <BSTR> propertyDescriptions;
    868             com::SafeArray <ULONG> propertyTypes;
    869             com::SafeArray <ULONG> propertyFlags;
    870             com::SafeArray <BSTR> propertyDefaults;
     866            com::SafeArray<BSTR> propertyNames;
     867            com::SafeArray<BSTR> propertyDescriptions;
     868            com::SafeArray<ULONG> propertyTypes;
     869            com::SafeArray<ULONG> propertyFlags;
     870            com::SafeArray<BSTR> propertyDefaults;
    871871            CHECK_ERROR_BREAK (hardDiskFormats [i],
    872872                               DescribeProperties (ComSafeArrayAsOutParam (propertyNames),
     
    906906    {
    907907        {
    908             com::SafeIfaceArray <IHardDisk> disks;
     908            com::SafeIfaceArray<IHardDisk> disks;
    909909            CHECK_ERROR_BREAK (virtualBox,
    910910                               COMGETTER(HardDisks)(ComSafeArrayAsOutParam (disks)));
     
    966966        }
    967967        {
    968             com::SafeIfaceArray <IDVDImage> images;
     968            com::SafeIfaceArray<IDVDImage> images;
    969969            CHECK_ERROR_BREAK (virtualBox,
    970970                               COMGETTER(DVDImages) (ComSafeArrayAsOutParam (images)));
     
    10311031    do
    10321032    {
    1033         ComPtr <IMachine> machine;
     1033        ComPtr<IMachine> machine;
    10341034        Bstr name = argc > 1 ? argv [1] : "dos";
    10351035        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
     
    10401040        CHECK_RC_BREAK (virtualBox->OpenSession (session, guid));
    10411041#if 1
    1042         ComPtr <IMachine> sessionMachine;
     1042        ComPtr<IMachine> sessionMachine;
    10431043        RTPrintf ("Getting sessioned machine object...\n");
    10441044        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
     
    10481048        RTPrintf ("\n");
    10491049        RTPrintf ("Enabling the VRDP server (must succeed even if the VM is saved):\n");
    1050         ComPtr <IVRDPServer> vrdp;
     1050        ComPtr<IVRDPServer> vrdp;
    10511051        CHECK_ERROR_BREAK (sessionMachine, COMGETTER(VRDPServer) (vrdp.asOutParam()));
    10521052        if (FAILED (vrdp->COMSETTER(Enabled) (TRUE)))
     
    10631063#endif
    10641064#if 0
    1065         ComPtr <IConsole> console;
     1065        ComPtr<IConsole> console;
    10661066        RTPrintf ("Getting the console object...\n");
    10671067        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
    10681068        RTPrintf ("Discarding the current machine state...\n");
    1069         ComPtr <IProgress> progress;
     1069        ComPtr<IProgress> progress;
    10701070        CHECK_ERROR_BREAK (console, DiscardCurrentState (progress.asOutParam()));
    10711071        RTPrintf ("Waiting for completion...\n");
     
    10761076            PRINT_ERROR_INFO (ei);
    10771077
    1078             ComPtr <IUnknown> initiator;
     1078            ComPtr<IUnknown> initiator;
    10791079            CHECK_ERROR_BREAK (progress, COMGETTER(Initiator) (initiator.asOutParam()));
    10801080
    10811081            RTPrintf ("initiator(unk) = %p\n", (IUnknown *) initiator);
    1082             RTPrintf ("console(unk) = %p\n", (IUnknown *) ComPtr <IUnknown> ((IConsole *) console));
     1082            RTPrintf ("console(unk) = %p\n", (IUnknown *) ComPtr<IUnknown> ((IConsole *) console));
    10831083            RTPrintf ("console = %p\n", (IConsole *) console);
    10841084        }
     
    10971097    do
    10981098    {
    1099         ComPtr <IMachine> machine;
     1099        ComPtr<IMachine> machine;
    11001100        Bstr name = L"dos";
    11011101        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
     
    11041104        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    11051105        RTPrintf ("Opening a remote session for this machine...\n");
    1106         ComPtr <IProgress> progress;
     1106        ComPtr<IProgress> progress;
    11071107        CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, Bstr("gui"),
    11081108                                                       NULL, progress.asOutParam()));
    11091109        RTPrintf ("Waiting for the session to open...\n");
    11101110        CHECK_RC_BREAK (progress->WaitForCompletion (-1));
    1111         ComPtr <IMachine> sessionMachine;
     1111        ComPtr<IMachine> sessionMachine;
    11121112        RTPrintf ("Getting sessioned machine object...\n");
    11131113        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
    1114         ComPtr <IConsole> console;
     1114        ComPtr<IConsole> console;
    11151115        RTPrintf ("Getting console object...\n");
    11161116        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
     
    11311131    do
    11321132    {
    1133         ComPtr <IMachine> machine;
     1133        ComPtr<IMachine> machine;
    11341134        Bstr name = "dos";
    11351135        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
     
    11391139        RTPrintf ("Opening an existing remote session for this machine...\n");
    11401140        CHECK_RC_BREAK (virtualBox->OpenExistingSession (session, guid));
    1141         ComPtr <IMachine> sessionMachine;
     1141        ComPtr<IMachine> sessionMachine;
    11421142        RTPrintf ("Getting sessioned machine object...\n");
    11431143        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
     
    11491149#endif
    11501150#if 0
    1151         ComPtr <IConsole> console;
     1151        ComPtr<IConsole> console;
    11521152        RTPrintf ("Getting console object...\n");
    11531153        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
     
    11671167    do {
    11681168        // Get host
    1169         ComPtr <IHost> host;
     1169        ComPtr<IHost> host;
    11701170        CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host) (host.asOutParam()));
    11711171
     
    11811181    do {
    11821182        // Get host
    1183         ComPtr <IHost> host;
     1183        ComPtr<IHost> host;
    11841184        CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host) (host.asOutParam()));
    11851185
    1186         com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
     1186        com::SafeIfaceArray<IHostNetworkInterface> hostNetworkInterfaces;
    11871187        CHECK_ERROR_BREAK(host,
    11881188                          COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
     
    12221222    do {
    12231223        // Get collector
    1224         ComPtr <IPerformanceCollector> collector;
     1224        ComPtr<IPerformanceCollector> collector;
    12251225        CHECK_ERROR_BREAK (virtualBox,
    12261226                           COMGETTER(PerformanceCollector) (collector.asOutParam()));
     
    12301230        Bstr baseMetricNames[] = { L"CPU/Load,RAM/Usage" };
    12311231        com::SafeArray<BSTR> baseMetrics (1);
    1232         baseMetricNames[0].cloneTo (&baseMetrics [0]);
     1232        baseMetricNames[0].cloneTo(&baseMetrics [0]);
    12331233
    12341234        // Get host
    1235         ComPtr <IHost> host;
     1235        ComPtr<IHost> host;
    12361236        CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host) (host.asOutParam()));
    12371237
    12381238        // Get machine
    1239         ComPtr <IMachine> machine;
     1239        ComPtr<IMachine> machine;
    12401240        Bstr name = argc > 1 ? argv [1] : "dsl";
    12411241        Bstr sessionType = argc > 2 ? argv [2] : "vrdp";
     
    12471247        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    12481248        RTPrintf ("Opening a remote session for this machine...\n");
    1249         ComPtr <IProgress> progress;
     1249        ComPtr<IProgress> progress;
    12501250        CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, sessionType,
    12511251                                                       NULL, progress.asOutParam()));
    12521252        RTPrintf ("Waiting for the session to open...\n");
    12531253        CHECK_RC_BREAK (progress->WaitForCompletion (-1));
    1254         ComPtr <IMachine> sessionMachine;
     1254        ComPtr<IMachine> sessionMachine;
    12551255        RTPrintf ("Getting sessioned machine object...\n");
    12561256        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
     
    12701270
    12711271        // Get console
    1272         ComPtr <IConsole> console;
     1272        ComPtr<IConsole> console;
    12731273        RTPrintf ("Getting console object...\n");
    12741274        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
     
    13411341        RTPrintf ("Try to open %ls ...\n", ovf.raw());
    13421342
    1343         ComPtr <IAppliance> appliance;
     1343        ComPtr<IAppliance> appliance;
    13441344        CHECK_ERROR_BREAK (virtualBox,
    13451345                           CreateAppliance (appliance.asOutParam()));
     
    14121412                           ImportMachines (progress.asOutParam()));
    14131413        CHECK_ERROR (progress, WaitForCompletion (-1));
    1414         if (SUCCEEDED (rc))
     1414        if (SUCCEEDED(rc))
    14151415        {
    14161416            /* Check if the import was successfully */
     
    14521452#ifdef VBOX_WITH_RESOURCE_USAGE_API
    14531453static void queryMetrics (ComPtr<IVirtualBox> aVirtualBox,
    1454                           ComPtr <IPerformanceCollector> collector,
     1454                          ComPtr<IPerformanceCollector> collector,
    14551455                          ComSafeArrayIn (IUnknown *, objects))
    14561456{
     
    14601460    Bstr metricNames[] = { L"*" };
    14611461    com::SafeArray<BSTR> metrics (1);
    1462     metricNames[0].cloneTo (&metrics [0]);
     1462    metricNames[0].cloneTo(&metrics [0]);
    14631463    com::SafeArray<BSTR>          retNames;
    14641464    com::SafeIfaceArray<IUnknown> retObjects;
  • trunk/src/VBox/Main/testcase/tstHostHardwareLinux.cpp

    r21436 r21878  
    4646    g_testHostHardwareLinux = true;
    4747    rc = driveInfo.updateFloppies();
    48     if (RT_SUCCESS (rc))
     48    if (RT_SUCCESS(rc))
    4949        rc = driveInfo.updateDVDs();
    50     if (RT_FAILURE (rc))
     50    if (RT_FAILURE(rc))
    5151    {
    5252        RTPrintf("Failed to update the host drive information, error %Rrc\n",
     
    7979    VBoxMainUSBDeviceInfo deviceInfo;
    8080    rc = deviceInfo.UpdateDevices();
    81     if (RT_FAILURE (rc))
     81    if (RT_FAILURE(rc))
    8282    {
    8383        RTPrintf ("Failed to update the host USB device information, error %Rrc\n",
  • trunk/src/VBox/Main/testcase/tstVBoxAPILinux.cpp

    r20267 r21878  
    589589    nsCOMPtr <nsIExceptionService> es;
    590590    es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
    591     if (NS_SUCCEEDED (rc))
     591    if (NS_SUCCEEDED(rc))
    592592    {
    593593        nsCOMPtr <nsIExceptionManager> em;
    594594        rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
    595         if (NS_SUCCEEDED (rc))
     595        if (NS_SUCCEEDED(rc))
    596596        {
    597597            nsCOMPtr<nsIException> ex;
    598598            rc = em->GetCurrentException (getter_AddRefs (ex));
    599             if (NS_SUCCEEDED (rc) && ex)
     599            if (NS_SUCCEEDED(rc) && ex)
    600600            {
    601601                nsCOMPtr <IVirtualBoxErrorInfo> info;
  • trunk/src/VBox/Main/webservice/vboxweb.h

    r21763 r21878  
    3838 ****************************************************************************/
    3939
    40 extern ComPtr <IVirtualBox> G_pVirtualBox;
     40extern ComPtr<IVirtualBox> G_pVirtualBox;
    4141extern bool g_fVerbose;
    4242
  • trunk/src/VBox/Main/win/HostPowerWin.cpp

    r21243 r21878  
    4343                             RTTHREADTYPE_GUI, RTTHREADFLAGS_WAITABLE, "MainPower");
    4444
    45     if (RT_FAILURE (rc))
     45    if (RT_FAILURE(rc))
    4646    {
    4747        Log(("HostPowerServiceWin::HostPowerServiceWin: RTThreadCreate failed with %Rrc\n", rc));
  • trunk/src/VBox/Main/win/NetIf-win.cpp

    r19598 r21878  
    202202    /* for SVCHlpMsg::CreateHostOnlyNetworkInterface */
    203203    Bstr name;
    204     ComObjPtr <HostNetworkInterface> iface;
    205     ComObjPtr <VirtualBox> vBox;
     204    ComObjPtr<HostNetworkInterface> iface;
     205    ComObjPtr<VirtualBox> vBox;
    206206    /* for SVCHlpMsg::RemoveHostOnlyNetworkInterface */
    207207    Guid guid;
     
    224224                  aClient, aProgress, aUser));
    225225
    226     AssertReturn ((aClient == NULL && aProgress == NULL && aVrc == NULL) ||
     226    AssertReturn((aClient == NULL && aProgress == NULL && aVrc == NULL) ||
    227227                  (aClient != NULL && aProgress != NULL && aVrc != NULL),
    228228                  E_POINTER);
    229     AssertReturn (aUser, E_POINTER);
     229    AssertReturn(aUser, E_POINTER);
    230230
    231231    std::auto_ptr <NetworkInterfaceHelperClientData>
     
    250250            /* write message and parameters */
    251251            vrc = aClient->write (d->msgCode);
    252             if (RT_FAILURE (vrc)) break;
     252            if (RT_FAILURE(vrc)) break;
    253253//            vrc = aClient->write (Utf8Str (d->name));
    254 //            if (RT_FAILURE (vrc)) break;
     254//            if (RT_FAILURE(vrc)) break;
    255255
    256256            /* wait for a reply */
     
    261261
    262262                vrc = aClient->read (reply);
    263                 if (RT_FAILURE (vrc)) break;
     263                if (RT_FAILURE(vrc)) break;
    264264
    265265                switch (reply)
     
    271271                        Utf8Str name;
    272272                        vrc = aClient->read (name);
    273                         if (RT_FAILURE (vrc)) break;
     273                        if (RT_FAILURE(vrc)) break;
    274274                        vrc = aClient->read (guid);
    275                         if (RT_FAILURE (vrc)) break;
     275                        if (RT_FAILURE(vrc)) break;
    276276
    277277                        LogFlowFunc (("Network connection GUID = {%RTuuid}\n", guid.raw()));
     
    296296                        Utf8Str errMsg;
    297297                        vrc = aClient->read (errMsg);
    298                         if (RT_FAILURE (vrc)) break;
     298                        if (RT_FAILURE(vrc)) break;
    299299
    300300                        rc = E_FAIL;//TODO: setError (E_FAIL, errMsg);
     
    322322            /* write message and parameters */
    323323            vrc = aClient->write (d->msgCode);
    324             if (RT_FAILURE (vrc)) break;
     324            if (RT_FAILURE(vrc)) break;
    325325            vrc = aClient->write (d->guid);
    326             if (RT_FAILURE (vrc)) break;
     326            if (RT_FAILURE(vrc)) break;
    327327
    328328            /* wait for a reply */
     
    333333
    334334                vrc = aClient->read (reply);
    335                 if (RT_FAILURE (vrc)) break;
     335                if (RT_FAILURE(vrc)) break;
    336336
    337337                switch (reply)
     
    349349                        Utf8Str errMsg;
    350350                        vrc = aClient->read (errMsg);
    351                         if (RT_FAILURE (vrc)) break;
     351                        if (RT_FAILURE(vrc)) break;
    352352
    353353                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     
    375375            /* write message and parameters */
    376376            vrc = aClient->write (d->msgCode);
    377             if (RT_FAILURE (vrc)) break;
     377            if (RT_FAILURE(vrc)) break;
    378378            vrc = aClient->write (d->guid);
    379             if (RT_FAILURE (vrc)) break;
     379            if (RT_FAILURE(vrc)) break;
    380380
    381381            /* wait for a reply */
     
    386386
    387387                vrc = aClient->read (reply);
    388                 if (RT_FAILURE (vrc)) break;
     388                if (RT_FAILURE(vrc)) break;
    389389
    390390                switch (reply)
     
    402402                        Utf8Str errMsg;
    403403                        vrc = aClient->read (errMsg);
    404                         if (RT_FAILURE (vrc)) break;
     404                        if (RT_FAILURE(vrc)) break;
    405405
    406406                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     
    428428            /* write message and parameters */
    429429            vrc = aClient->write (d->msgCode);
    430             if (RT_FAILURE (vrc)) break;
     430            if (RT_FAILURE(vrc)) break;
    431431            vrc = aClient->write (d->guid);
    432             if (RT_FAILURE (vrc)) break;
     432            if (RT_FAILURE(vrc)) break;
    433433            vrc = aClient->write (d->u.StaticIP.IPAddress);
    434             if (RT_FAILURE (vrc)) break;
     434            if (RT_FAILURE(vrc)) break;
    435435            vrc = aClient->write (d->u.StaticIP.IPNetMask);
    436             if (RT_FAILURE (vrc)) break;
     436            if (RT_FAILURE(vrc)) break;
    437437
    438438            /* wait for a reply */
     
    443443
    444444                vrc = aClient->read (reply);
    445                 if (RT_FAILURE (vrc)) break;
     445                if (RT_FAILURE(vrc)) break;
    446446
    447447                switch (reply)
     
    459459                        Utf8Str errMsg;
    460460                        vrc = aClient->read (errMsg);
    461                         if (RT_FAILURE (vrc)) break;
     461                        if (RT_FAILURE(vrc)) break;
    462462
    463463                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     
    485485            /* write message and parameters */
    486486            vrc = aClient->write (d->msgCode);
    487             if (RT_FAILURE (vrc)) break;
     487            if (RT_FAILURE(vrc)) break;
    488488            vrc = aClient->write (d->guid);
    489             if (RT_FAILURE (vrc)) break;
     489            if (RT_FAILURE(vrc)) break;
    490490            vrc = aClient->write (Utf8Str(d->u.StaticIPV6.IPV6Address));
    491             if (RT_FAILURE (vrc)) break;
     491            if (RT_FAILURE(vrc)) break;
    492492            vrc = aClient->write (d->u.StaticIPV6.IPV6NetMaskLength);
    493             if (RT_FAILURE (vrc)) break;
     493            if (RT_FAILURE(vrc)) break;
    494494
    495495            /* wait for a reply */
     
    500500
    501501                vrc = aClient->read (reply);
    502                 if (RT_FAILURE (vrc)) break;
     502                if (RT_FAILURE(vrc)) break;
    503503
    504504                switch (reply)
     
    516516                        Utf8Str errMsg;
    517517                        vrc = aClient->read (errMsg);
    518                         if (RT_FAILURE (vrc)) break;
     518                        if (RT_FAILURE(vrc)) break;
    519519
    520520                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     
    542542            /* write message and parameters */
    543543            vrc = aClient->write (d->msgCode);
    544             if (RT_FAILURE (vrc)) break;
     544            if (RT_FAILURE(vrc)) break;
    545545            vrc = aClient->write (d->guid);
    546             if (RT_FAILURE (vrc)) break;
     546            if (RT_FAILURE(vrc)) break;
    547547
    548548            /* wait for a reply */
     
    553553
    554554                vrc = aClient->read (reply);
    555                 if (RT_FAILURE (vrc)) break;
     555                if (RT_FAILURE(vrc)) break;
    556556
    557557                switch (reply)
     
    569569                        Utf8Str errMsg;
    570570                        vrc = aClient->read (errMsg);
    571                         if (RT_FAILURE (vrc)) break;
     571                        if (RT_FAILURE(vrc)) break;
    572572
    573573                        rc = E_FAIL; // TODO: setError (E_FAIL, errMsg);
     
    610610    LogFlowFunc (("aClient={%p}, aMsgCode=%d\n", aClient, aMsgCode));
    611611
    612     AssertReturn (aClient, VERR_INVALID_POINTER);
     612    AssertReturn(aClient, VERR_INVALID_POINTER);
    613613
    614614    int vrc = VINF_SUCCESS;
     
    623623//            Utf8Str name;
    624624//            vrc = aClient->read (name);
    625 //            if (RT_FAILURE (vrc)) break;
     625//            if (RT_FAILURE(vrc)) break;
    626626
    627627            Guid guid;
     
    646646                /* write success followed by GUID */
    647647                vrc = aClient->write (SVCHlpMsg::CreateHostOnlyNetworkInterface_OK);
    648                 if (RT_FAILURE (vrc)) break;
     648                if (RT_FAILURE(vrc)) break;
    649649                vrc = aClient->write (Utf8Str (name));
    650                 if (RT_FAILURE (vrc)) break;
     650                if (RT_FAILURE(vrc)) break;
    651651                vrc = aClient->write (guid);
    652                 if (RT_FAILURE (vrc)) break;
     652                if (RT_FAILURE(vrc)) break;
    653653            }
    654654            else
     
    660660                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    661661                vrc = aClient->write (SVCHlpMsg::Error);
    662                 if (RT_FAILURE (vrc)) break;
     662                if (RT_FAILURE(vrc)) break;
    663663                vrc = aClient->write (errMsg);
    664                 if (RT_FAILURE (vrc)) break;
     664                if (RT_FAILURE(vrc)) break;
    665665            }
    666666
     
    675675
    676676            vrc = aClient->read (guid);
    677             if (RT_FAILURE (vrc)) break;
     677            if (RT_FAILURE(vrc)) break;
    678678
    679679            Utf8Str errMsg;
     
    684684                /* write parameter-less success */
    685685                vrc = aClient->write (SVCHlpMsg::OK);
    686                 if (RT_FAILURE (vrc)) break;
     686                if (RT_FAILURE(vrc)) break;
    687687            }
    688688            else
     
    694694                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    695695                vrc = aClient->write (SVCHlpMsg::Error);
    696                 if (RT_FAILURE (vrc)) break;
     696                if (RT_FAILURE(vrc)) break;
    697697                vrc = aClient->write (errMsg);
    698                 if (RT_FAILURE (vrc)) break;
     698                if (RT_FAILURE(vrc)) break;
    699699            }
    700700
     
    709709            ULONG maskLengthV6;
    710710            vrc = aClient->read (guid);
    711             if (RT_FAILURE (vrc)) break;
     711            if (RT_FAILURE(vrc)) break;
    712712            vrc = aClient->read (ipV6);
    713             if (RT_FAILURE (vrc)) break;
     713            if (RT_FAILURE(vrc)) break;
    714714            vrc = aClient->read (maskLengthV6);
    715             if (RT_FAILURE (vrc)) break;
     715            if (RT_FAILURE(vrc)) break;
    716716
    717717            Utf8Str errMsg;
    718718            vrc = VERR_NOT_IMPLEMENTED;
    719719
    720             if (RT_SUCCESS (vrc))
     720            if (RT_SUCCESS(vrc))
    721721            {
    722722                /* write success followed by GUID */
    723723                vrc = aClient->write (SVCHlpMsg::OK);
    724                 if (RT_FAILURE (vrc)) break;
     724                if (RT_FAILURE(vrc)) break;
    725725            }
    726726            else
     
    730730                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    731731                vrc = aClient->write (SVCHlpMsg::Error);
    732                 if (RT_FAILURE (vrc)) break;
     732                if (RT_FAILURE(vrc)) break;
    733733                vrc = aClient->write (errMsg);
    734                 if (RT_FAILURE (vrc)) break;
     734                if (RT_FAILURE(vrc)) break;
    735735            }
    736736
     
    744744            ULONG ip, mask;
    745745            vrc = aClient->read (guid);
    746             if (RT_FAILURE (vrc)) break;
     746            if (RT_FAILURE(vrc)) break;
    747747            vrc = aClient->read (ip);
    748             if (RT_FAILURE (vrc)) break;
     748            if (RT_FAILURE(vrc)) break;
    749749            vrc = aClient->read (mask);
    750             if (RT_FAILURE (vrc)) break;
     750            if (RT_FAILURE(vrc)) break;
    751751
    752752            Utf8Str errMsg;
     
    757757                /* write success followed by GUID */
    758758                vrc = aClient->write (SVCHlpMsg::OK);
    759                 if (RT_FAILURE (vrc)) break;
     759                if (RT_FAILURE(vrc)) break;
    760760            }
    761761            else
     
    766766                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    767767                vrc = aClient->write (SVCHlpMsg::Error);
    768                 if (RT_FAILURE (vrc)) break;
     768                if (RT_FAILURE(vrc)) break;
    769769                vrc = aClient->write (errMsg);
    770                 if (RT_FAILURE (vrc)) break;
     770                if (RT_FAILURE(vrc)) break;
    771771            }
    772772
     
    779779            Guid guid;
    780780            vrc = aClient->read (guid);
    781             if (RT_FAILURE (vrc)) break;
     781            if (RT_FAILURE(vrc)) break;
    782782
    783783            Utf8Str errMsg;
     
    788788                /* write success followed by GUID */
    789789                vrc = aClient->write (SVCHlpMsg::OK);
    790                 if (RT_FAILURE (vrc)) break;
     790                if (RT_FAILURE(vrc)) break;
    791791            }
    792792            else
     
    797797                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    798798                vrc = aClient->write (SVCHlpMsg::Error);
    799                 if (RT_FAILURE (vrc)) break;
     799                if (RT_FAILURE(vrc)) break;
    800800                vrc = aClient->write (errMsg);
    801                 if (RT_FAILURE (vrc)) break;
     801                if (RT_FAILURE(vrc)) break;
    802802            }
    803803
     
    810810            Guid guid;
    811811            vrc = aClient->read (guid);
    812             if (RT_FAILURE (vrc)) break;
     812            if (RT_FAILURE(vrc)) break;
    813813
    814814            Utf8Str errMsg;
     
    819819                /* write success followed by GUID */
    820820                vrc = aClient->write (SVCHlpMsg::OK);
    821                 if (RT_FAILURE (vrc)) break;
     821                if (RT_FAILURE(vrc)) break;
    822822            }
    823823            else
     
    828828                    errMsg = Utf8StrFmt ("Unspecified error (%Rrc)", vrc);
    829829                vrc = aClient->write (SVCHlpMsg::Error);
    830                 if (RT_FAILURE (vrc)) break;
     830                if (RT_FAILURE(vrc)) break;
    831831                vrc = aClient->write (errMsg);
    832                 if (RT_FAILURE (vrc)) break;
     832                if (RT_FAILURE(vrc)) break;
    833833            }
    834834
     
    859859    info.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
    860860    rc = GetVersionEx ((OSVERSIONINFO *) &info);
    861     AssertReturn (rc != 0, FALSE);
     861    AssertReturn(rc != 0, FALSE);
    862862
    863863    LogFlowFunc (("dwMajorVersion=%d, dwMinorVersion=%d\n",
     
    897897/* end */
    898898
    899 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc, HostNetworkInterfaceType enmType)
     899static int vboxNetWinAddComponent(std::list <ComObjPtr<HostNetworkInterface> > * pPist, INetCfgComponent * pncc, HostNetworkInterfaceType enmType)
    900900{
    901901    LPWSTR              lpszName;
     
    926926            }
    927927            /* create a new object and add it to the list */
    928             ComObjPtr <HostNetworkInterface> iface;
     928            ComObjPtr<HostNetworkInterface> iface;
    929929            iface.createObject();
    930930            /* remove the curly bracket at the end */
    931             if (SUCCEEDED (iface->init (name, enmType, &Info)))
     931            if (SUCCEEDED(iface->init (name, enmType, &Info)))
    932932            {
    933933                pPist->push_back (iface);
     
    948948
    949949
    950 static int netIfListHostAdapters(std::list <ComObjPtr <HostNetworkInterface> > &list)
     950static int netIfListHostAdapters(std::list <ComObjPtr<HostNetworkInterface> > &list)
    951951{
    952952#ifndef VBOX_WITH_NETFLT
     
    10541054#else
    10551055    /* create a progress object */
    1056     ComObjPtr <Progress> progress;
     1056    ComObjPtr<Progress> progress;
    10571057    progress.createObject();
    10581058
     
    10661066        if(SUCCEEDED(rc))
    10671067        {
    1068             CheckComRCReturnRC (rc);
    1069             progress.queryInterfaceTo (aProgress);
     1068            CheckComRCReturnRC(rc);
     1069            progress.queryInterfaceTo(aProgress);
    10701070
    10711071            /* create a new uninitialized host interface object */
    1072             ComObjPtr <HostNetworkInterface> iface;
     1072            ComObjPtr<HostNetworkInterface> iface;
    10731073            iface.createObject();
    1074             iface.queryInterfaceTo (aHostNetworkInterface);
     1074            iface.queryInterfaceTo(aHostNetworkInterface);
    10751075
    10761076            /* create the networkInterfaceHelperClient() argument */
    10771077            std::auto_ptr <NetworkInterfaceHelperClientData>
    10781078                d (new NetworkInterfaceHelperClientData());
    1079             AssertReturn (d.get(), E_OUTOFMEMORY);
     1079            AssertReturn(d.get(), E_OUTOFMEMORY);
    10801080
    10811081            d->msgCode = SVCHlpMsg::CreateHostOnlyNetworkInterface;
     
    10901090                progress);
    10911091
    1092             if (SUCCEEDED (rc))
     1092            if (SUCCEEDED(rc))
    10931093            {
    10941094                /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    11101110#else
    11111111    /* create a progress object */
    1112     ComObjPtr <Progress> progress;
     1112    ComObjPtr<Progress> progress;
    11131113    progress.createObject();
    11141114    ComPtr<IHost> host;
     
    11211121        if(SUCCEEDED(rc))
    11221122        {
    1123             CheckComRCReturnRC (rc);
    1124             progress.queryInterfaceTo (aProgress);
     1123            CheckComRCReturnRC(rc);
     1124            progress.queryInterfaceTo(aProgress);
    11251125
    11261126            /* create the networkInterfaceHelperClient() argument */
    11271127            std::auto_ptr <NetworkInterfaceHelperClientData>
    11281128                d (new NetworkInterfaceHelperClientData());
    1129             AssertReturn (d.get(), E_OUTOFMEMORY);
     1129            AssertReturn(d.get(), E_OUTOFMEMORY);
    11301130
    11311131            d->msgCode = SVCHlpMsg::RemoveHostOnlyNetworkInterface;
     
    11381138                progress);
    11391139
    1140             if (SUCCEEDED (rc))
     1140            if (SUCCEEDED(rc))
    11411141            {
    11421142                /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    11651165        {
    11661166            /* create a progress object */
    1167             ComObjPtr <Progress> progress;
     1167            ComObjPtr<Progress> progress;
    11681168            progress.createObject();
    11691169//            ComPtr<IHost> host;
     
    11761176                if(SUCCEEDED(rc))
    11771177                {
    1178                     CheckComRCReturnRC (rc);
    1179 //                    progress.queryInterfaceTo (aProgress);
     1178                    CheckComRCReturnRC(rc);
     1179//                    progress.queryInterfaceTo(aProgress);
    11801180
    11811181                    /* create the networkInterfaceHelperClient() argument */
    11821182                    std::auto_ptr <NetworkInterfaceHelperClientData>
    11831183                        d (new NetworkInterfaceHelperClientData());
    1184                     AssertReturn (d.get(), E_OUTOFMEMORY);
     1184                    AssertReturn(d.get(), E_OUTOFMEMORY);
    11851185
    11861186                    d->msgCode = SVCHlpMsg::EnableStaticIpConfig;
     
    11961196                        progress);
    11971197
    1198                     if (SUCCEEDED (rc))
     1198                    if (SUCCEEDED(rc))
    11991199                    {
    12001200                        /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    12271227        {
    12281228            /* create a progress object */
    1229             ComObjPtr <Progress> progress;
     1229            ComObjPtr<Progress> progress;
    12301230            progress.createObject();
    12311231//            ComPtr<IHost> host;
     
    12381238                if(SUCCEEDED(rc))
    12391239                {
    1240                     CheckComRCReturnRC (rc);
    1241 //                    progress.queryInterfaceTo (aProgress);
     1240                    CheckComRCReturnRC(rc);
     1241//                    progress.queryInterfaceTo(aProgress);
    12421242
    12431243                    /* create the networkInterfaceHelperClient() argument */
    12441244                    std::auto_ptr <NetworkInterfaceHelperClientData>
    12451245                        d (new NetworkInterfaceHelperClientData());
    1246                     AssertReturn (d.get(), E_OUTOFMEMORY);
     1246                    AssertReturn(d.get(), E_OUTOFMEMORY);
    12471247
    12481248                    d->msgCode = SVCHlpMsg::EnableStaticIpConfigV6;
     
    12581258                        progress);
    12591259
    1260                     if (SUCCEEDED (rc))
     1260                    if (SUCCEEDED(rc))
    12611261                    {
    12621262                        /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    12891289        {
    12901290            /* create a progress object */
    1291             ComObjPtr <Progress> progress;
     1291            ComObjPtr<Progress> progress;
    12921292            progress.createObject();
    12931293//            ComPtr<IHost> host;
     
    13001300                if(SUCCEEDED(rc))
    13011301                {
    1302                     CheckComRCReturnRC (rc);
    1303 //                    progress.queryInterfaceTo (aProgress);
     1302                    CheckComRCReturnRC(rc);
     1303//                    progress.queryInterfaceTo(aProgress);
    13041304
    13051305                    /* create the networkInterfaceHelperClient() argument */
    13061306                    std::auto_ptr <NetworkInterfaceHelperClientData>
    13071307                        d (new NetworkInterfaceHelperClientData());
    1308                     AssertReturn (d.get(), E_OUTOFMEMORY);
     1308                    AssertReturn(d.get(), E_OUTOFMEMORY);
    13091309
    13101310                    d->msgCode = SVCHlpMsg::EnableDynamicIpConfig;
     
    13181318                        progress);
    13191319
    1320                     if (SUCCEEDED (rc))
     1320                    if (SUCCEEDED(rc))
    13211321                    {
    13221322                        /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    13491349        {
    13501350            /* create a progress object */
    1351             ComObjPtr <Progress> progress;
     1351            ComObjPtr<Progress> progress;
    13521352            progress.createObject();
    13531353//            ComPtr<IHost> host;
     
    13601360                if(SUCCEEDED(rc))
    13611361                {
    1362                     CheckComRCReturnRC (rc);
    1363 //                    progress.queryInterfaceTo (aProgress);
     1362                    CheckComRCReturnRC(rc);
     1363//                    progress.queryInterfaceTo(aProgress);
    13641364
    13651365                    /* create the networkInterfaceHelperClient() argument */
    13661366                    std::auto_ptr <NetworkInterfaceHelperClientData>
    13671367                        d (new NetworkInterfaceHelperClientData());
    1368                     AssertReturn (d.get(), E_OUTOFMEMORY);
     1368                    AssertReturn(d.get(), E_OUTOFMEMORY);
    13691369
    13701370                    d->msgCode = SVCHlpMsg::DhcpRediscover;
     
    13781378                        progress);
    13791379
    1380                     if (SUCCEEDED (rc))
     1380                    if (SUCCEEDED(rc))
    13811381                    {
    13821382                        /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */
     
    13941394}
    13951395
    1396 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list)
     1396int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
    13971397{
    13981398#ifndef VBOX_WITH_NETFLT
  • trunk/src/VBox/Main/win/svchlp.cpp

    r21404 r21878  
    6565int SVCHlpClient::create (const char *aName)
    6666{
    67     AssertReturn (aName, VERR_INVALID_PARAMETER);
     67    AssertReturn(aName, VERR_INVALID_PARAMETER);
    6868
    6969    if (mIsOpen)
     
    9494int SVCHlpClient::open (const char *aName)
    9595{
    96     AssertReturn (aName, VERR_INVALID_PARAMETER);
     96    AssertReturn(aName, VERR_INVALID_PARAMETER);
    9797
    9898    if (mIsOpen)
     
    161161int SVCHlpClient::write (const void *aVal, size_t aLen)
    162162{
    163     AssertReturn (aVal != NULL, VERR_INVALID_PARAMETER);
    164     AssertReturn (aLen != 0, VERR_INVALID_PARAMETER);
     163    AssertReturn(aVal != NULL, VERR_INVALID_PARAMETER);
     164    AssertReturn(aLen != 0, VERR_INVALID_PARAMETER);
    165165
    166166    if (!mIsOpen)
     
    169169    DWORD written = 0;
    170170    BOOL ok = WriteFile (mWriteEnd, aVal, (ULONG)aLen, &written, NULL);
    171     AssertReturn (!ok || written == aLen, VERR_GENERAL_FAILURE);
     171    AssertReturn(!ok || written == aLen, VERR_GENERAL_FAILURE);
    172172    return ok ? VINF_SUCCESS : rtErrConvertFromWin32OnFailure();
    173173}
     
    186186    /* write string length */
    187187    int vrc = write (len);
    188     if (RT_SUCCESS (vrc))
     188    if (RT_SUCCESS(vrc))
    189189    {
    190190        /* write string data */
     
    203203int SVCHlpClient::read (void *aVal, size_t aLen)
    204204{
    205     AssertReturn (aVal != NULL, VERR_INVALID_PARAMETER);
    206     AssertReturn (aLen != 0, VERR_INVALID_PARAMETER);
     205    AssertReturn(aVal != NULL, VERR_INVALID_PARAMETER);
     206    AssertReturn(aLen != 0, VERR_INVALID_PARAMETER);
    207207
    208208    if (!mIsOpen)
     
    211211    DWORD read = 0;
    212212    BOOL ok = ReadFile (mReadEnd, aVal, (ULONG)aLen, &read, NULL);
    213     AssertReturn (!ok || read == aLen, VERR_GENERAL_FAILURE);
     213    AssertReturn(!ok || read == aLen, VERR_GENERAL_FAILURE);
    214214    return ok ? VINF_SUCCESS : rtErrConvertFromWin32OnFailure();
    215215}
     
    224224    /* read string length */
    225225    int vrc = read (len);
    226     if (RT_FAILURE (vrc))
     226    if (RT_FAILURE(vrc))
    227227        return vrc;
    228228
     
    247247    Utf8Str guidStr;
    248248    int vrc = read (guidStr);
    249     if (RT_SUCCESS (vrc))
     249    if (RT_SUCCESS(vrc))
    250250        aGuid = Guid (guidStr.c_str());
    251251    return vrc;
     
    266266    {
    267267        vrc = read (msgCode);
    268         if (RT_FAILURE (vrc))
     268        if (RT_FAILURE(vrc))
    269269            return vrc;
    270270
     
    293293        }
    294294
    295         if (RT_FAILURE (vrc))
     295        if (RT_FAILURE(vrc))
    296296            return vrc;
    297297    }
  • trunk/src/VBox/Main/win/svcmain.cpp

    r14831 r21878  
    243243                vrc = VERR_INVALID_PARAMETER;
    244244
    245             if (RT_SUCCESS (vrc))
     245            if (RT_SUCCESS(vrc))
    246246            {
    247247                /* do the helper job */
    248248                SVCHlpServer server;
    249249                vrc = server.open (pipeName);
    250                 if (RT_SUCCESS (vrc))
     250                if (RT_SUCCESS(vrc))
    251251                    vrc = server.run();
    252252            }
    253             if (RT_FAILURE (vrc))
     253            if (RT_FAILURE(vrc))
    254254            {
    255255                Utf8Str err = Utf8StrFmt (
  • trunk/src/VBox/Main/xml/Settings.cpp

    r21428 r21878  
    105105        int64_t result;
    106106        int vrc = RTStrToInt64Full (aValue, 0, &result);
    107         if (RT_SUCCESS (vrc))
     107        if (RT_SUCCESS(vrc))
    108108        {
    109109            if (result >= (int64_t) aMin && result <= (int64_t) aMax)
     
    115115        uint64_t result;
    116116        int vrc = RTStrToUInt64Full (aValue, 0, &result);
    117         if (RT_SUCCESS (vrc))
     117        if (RT_SUCCESS(vrc))
    118118        {
    119119            if (result >= aMin && result <= aMax)
     
    249249        aBase = 10;
    250250    int vrc = RTStrFormatNumber (result.get(), aValue, aBase, 0, 0, flags);
    251     if (RT_SUCCESS (vrc))
     251    if (RT_SUCCESS(vrc))
    252252        return result;
    253253
     
    372372         * from <Foo/> (where NULL is pretty much expected). */
    373373        if (!mNodeText)
    374             unconst (mNodeText) =
     374            unconst(mNodeText) =
    375375                xmlNodeListGetString (mNode->doc, mNode->children, 0);
    376376        return (char *) mNodeText;
     
    943943int XmlTreeBackend::ReadCallback (void *aCtxt, char *aBuf, int aLen)
    944944{
    945     AssertReturn (aCtxt != NULL, 0);
     945    AssertReturn(aCtxt != NULL, 0);
    946946
    947947    Data::InputCtxt *ctxt = static_cast <Data::InputCtxt *> (aCtxt);
     
    964964int XmlTreeBackend::WriteCallback (void *aCtxt, const char *aBuf, int aLen)
    965965{
    966     AssertReturn (aCtxt != NULL, 0);
     966    AssertReturn(aCtxt != NULL, 0);
    967967
    968968    Data::OutputCtxt *ctxt = static_cast <Data::OutputCtxt *> (aCtxt);
     
    985985int XmlTreeBackend::CloseCallback (void *aCtxt)
    986986{
    987     AssertReturn (aCtxt != NULL, 0);
     987    AssertReturn(aCtxt != NULL, 0);
    988988
    989989    Data::IOCtxt *ctxt = static_cast <Data::IOCtxt *> (aCtxt);
     
    11041104                                                        xmlParserCtxtPtr aCtxt)
    11051105{
    1106     AssertReturn (sThat != NULL, NULL);
     1106    AssertReturn(sThat != NULL, NULL);
    11071107
    11081108    if (sThat->m->inputResolver == NULL)
  • trunk/src/VBox/Main/xpcom/server.cpp

    r20630 r21878  
    269269    nsresult postTo (nsIEventQueue *aEventQ)
    270270    {
    271         AssertReturn (mEv.that == NULL, NS_ERROR_FAILURE);
    272         AssertReturn (aEventQ, NS_ERROR_FAILURE);
     271        AssertReturn(mEv.that == NULL, NS_ERROR_FAILURE);
     272        AssertReturn(aEventQ, NS_ERROR_FAILURE);
    273273        nsresult rv = aEventQ->InitEvent (&mEv.e, NULL,
    274274                                          eventHandler, eventDestructor);
    275         if (NS_SUCCEEDED (rv))
     275        if (NS_SUCCEEDED(rv))
    276276        {
    277277            mEv.that = this;
    278278            rv = aEventQ->PostEvent (&mEv.e);
    279             if (NS_SUCCEEDED (rv))
     279            if (NS_SUCCEEDED(rv))
    280280                return rv;
    281281        }
     
    358358                int vrc = RTTimerLRStart (sTimer, uint64_t (VBoxSVC_ShutdownDelay) * 1000000);
    359359                AssertRC (vrc);
    360                 timerStarted = SUCCEEDED (vrc);
     360                timerStarted = SUCCEEDED(vrc);
    361361            }
    362362            else
     
    476476
    477477        /* create a critsect to protect object construction */
    478         if (RT_FAILURE (RTCritSectInit (&sLock)))
     478        if (RT_FAILURE(RTCritSectInit (&sLock)))
    479479            return NS_ERROR_OUT_OF_MEMORY;
    480480
    481481        int vrc = RTTimerLRCreateEx (&sTimer, 0, 0, ShutdownTimer, NULL);
    482         if (RT_FAILURE (vrc))
     482        if (RT_FAILURE(vrc))
    483483        {
    484484            LogFlowFunc (("Failed to create a timer! (vrc=%Rrc)\n", vrc));
     
    696696                        const nsModuleComponentInfoEx *info)
    697697{
    698     AssertReturn (result, NS_ERROR_INVALID_POINTER);
     698    AssertReturn(result, NS_ERROR_INVALID_POINTER);
    699699
    700700    nsresult rv = NS_NewGenericFactory (result, info);
    701     if (NS_SUCCEEDED (rv) && info && info->mFactoryConstructor)
     701    if (NS_SUCCEEDED(rv) && info && info->mFactoryConstructor)
    702702    {
    703703        rv = info->mFactoryConstructor();
     
    722722    nsresult rc = NS_OK;
    723723    const nsModuleComponentInfoEx *info = components;
    724     for (PRUint32 i = 0; i < count && NS_SUCCEEDED (rc); i++, info++)
     724    for (PRUint32 i = 0; i < count && NS_SUCCEEDED(rc); i++, info++)
    725725    {
    726726        /* skip components w/o a constructor */
     
    729729        nsIGenericFactory *factory;
    730730        rc = NS_NewGenericFactoryEx (&factory, info);
    731         if (NS_SUCCEEDED (rc))
     731        if (NS_SUCCEEDED(rc))
    732732        {
    733733            rc = registrar->RegisterFactory (info->mCID,
  • trunk/src/VBox/Main/xpcom/server_module.cpp

    r21179 r21878  
    126126             * executable is expected in the parent directory. */
    127127            nsCOMPtr <nsIProperties> dirServ = do_GetService (NS_DIRECTORY_SERVICE_CONTRACTID, &rc);
    128             if (NS_SUCCEEDED (rc))
     128            if (NS_SUCCEEDED(rc))
    129129            {
    130130                nsCOMPtr <nsIFile> componentDir;
     
    132132                                   NS_GET_IID (nsIFile), getter_AddRefs (componentDir));
    133133
    134                 if (NS_SUCCEEDED (rc))
     134                if (NS_SUCCEEDED(rc))
    135135                {
    136136                    nsCAutoString path;
     
    201201                RTPROCESS pid = NIL_RTPROCESS;
    202202                vrc = RTProcCreate (VBoxSVCPath, args, RTENV_DEFAULT, 0, &pid);
    203                 if (RT_FAILURE (vrc))
     203                if (RT_FAILURE(vrc))
    204204                {
    205205                    rc = NS_ERROR_FAILURE;
     
    213213                    RTThreadSleep (VBoxSVC_WaitSlice);
    214214                    rc = ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
    215                     if (NS_SUCCEEDED (rc))
     215                    if (NS_SUCCEEDED(rc))
    216216                        break;
    217217                    if (timeLeft <= VBoxSVC_WaitSlice)
     
    241241                                           (nsCID) NS_VIRTUALBOX_CID,
    242242                                           aIID, aResult);
    243             if (NS_SUCCEEDED (rc))
     243            if (NS_SUCCEEDED(rc))
    244244                break;
    245245
     
    254254                nsresult rc2 =
    255255                    ipcServ->ResolveClientName (VBOXSVC_IPC_NAME, &serverID);
    256                 if (NS_SUCCEEDED (rc2))
     256                if (NS_SUCCEEDED(rc2))
    257257                    break;
    258258
Note: See TracChangeset for help on using the changeset viewer.

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