Index: /trunk/include/VBox/com/assert.h
===================================================================
--- /trunk/include/VBox/com/assert.h	(revision 25148)
+++ /trunk/include/VBox/com/assert.h	(revision 25149)
@@ -110,30 +110,3 @@
     if (!SUCCEEDED (rc)) { AssertComRC (rc); throw rc; } else do {} while (0)
 
-/**
- *  Checks whether the given COM result code is successful.
- *  If not, executes the return statement with this result code.
- *
- *  @param rc   COM result code
- */
-#define CheckComRCReturnRC(rc)      \
-    if (!SUCCEEDED (rc)) { return (rc); } else do {} while (0)
-
-/**
- *  Checks whether the given COM result code is successful.
- *  If not, executes the break statement.
- *
- *  @param rc   COM result code
- */
-#define CheckComRCBreakRC(rc)      \
-    if (!SUCCEEDED (rc)) { break; } else do {} while (0)
-
-/**
- *  Checks whether the given COM result code is successful.
- *  If not, throws the given COM result.
- *
- *  @param rc   COM result code
- */
-#define CheckComRCThrowRC(rc)      \
-    if (!SUCCEEDED (rc)) { throw rc; } else do {} while (0)
-
 #endif // !___VBox_com_assert_h
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp	(revision 25148)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp	(revision 25149)
@@ -1031,5 +1031,5 @@
                                hardDisk.asOutParam()));
         }
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
 
         if (!port.isNull())
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 25148)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp	(revision 25149)
@@ -147,5 +147,5 @@
     BOOL accessible = FALSE;
     CHECK_ERROR(machine, COMGETTER(Accessible)(&accessible));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     Bstr uuid;
Index: /trunk/src/VBox/Main/ApplianceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ApplianceImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ApplianceImpl.cpp	(revision 25149)
@@ -819,5 +819,5 @@
 
     rc = task->startThread();
-    CheckComRCThrowRC(rc);
+    if (FAILED(rc)) throw rc;
 
     /* Don't destruct on success */
@@ -851,5 +851,5 @@
 
     rc = task->startThread();
-    CheckComRCThrowRC(rc);
+    if (FAILED(rc)) throw rc;
 
     /* Don't destruct on success */
@@ -921,5 +921,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -964,5 +964,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -1088,5 +1088,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -1103,5 +1103,5 @@
     bool fSessionOpen = false;
     rc = session.createInprocObject(CLSID_Session);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     const OVFReader &reader = *m->pReader;
@@ -1976,5 +1976,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -2179,5 +2179,5 @@
 
         rc = task->startThread();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* Don't destruct on success */
@@ -2240,5 +2240,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -3082,5 +3082,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = S_OK;
@@ -3259,5 +3259,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3279,5 +3279,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3337,5 +3337,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3358,5 +3358,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -3404,5 +3404,5 @@
     //  - Appropriate handle errors like not supported file formats
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock(this);
@@ -3416,8 +3416,8 @@
     ComPtr<ISystemProperties> systemProps;
     rc = mVirtualBox->COMGETTER(SystemProperties)(systemProps.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     Bstr bstrDefaultHardDiskLocation;
     rc = systemProps->COMGETTER(DefaultHardDiskFolder)(bstrDefaultHardDiskLocation.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (!m->pReader)
@@ -3438,7 +3438,7 @@
             ComObjPtr<VirtualSystemDescription> pNewDesc;
             rc = pNewDesc.createObject();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
             rc = pNewDesc->init();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             /* Guest OS type */
@@ -3515,5 +3515,5 @@
             ComPtr<IGuestOSType> pGuestOSType;
             rc = mVirtualBox->GetGuestOSType(Bstr(strOsTypeVBox), pGuestOSType.asOutParam());
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             /* CPU count */
@@ -3549,5 +3549,5 @@
                 ULONG memSizeVBox2;
                 rc = pGuestOSType->COMGETTER(RecommendedRAM)(&memSizeVBox2);
-                CheckComRCThrowRC(rc);
+                if (FAILED(rc)) throw rc;
                 /* VBox stores that in MByte */
                 ullMemSizeVBox = (uint64_t)memSizeVBox2;
@@ -3585,5 +3585,5 @@
                 NetworkAdapterType_T defaultAdapterVBox = NetworkAdapterType_Am79C970A;
                 rc = pGuestOSType->COMGETTER(AdapterType)(&defaultAdapterVBox);
-                CheckComRCThrowRC(rc);
+                if (FAILED(rc)) throw rc;
 
                 EthernetAdaptersList::const_iterator itEA;
@@ -3851,5 +3851,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock(this);
@@ -3882,5 +3882,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock(this);
@@ -3916,5 +3916,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock(this);
@@ -3966,5 +3966,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4040,5 +4040,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4067,5 +4067,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4129,5 +4129,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4185,5 +4185,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4234,5 +4234,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4280,5 +4280,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4392,5 +4392,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock1(this);
@@ -4447,7 +4447,7 @@
         // create a new virtual system
         rc = pNewDesc.createObject();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
         rc = pNewDesc->init();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* Guest OS type */
@@ -4824,5 +4824,5 @@
         Appliance *pAppliance = static_cast<Appliance*>(aAppliance);
         AutoCaller autoCaller1(pAppliance);
-        CheckComRCReturnRC(autoCaller1.rc());
+        if (FAILED(autoCaller1.rc())) return autoCaller1.rc();
 
         /* We return the new description to the caller */
Index: /trunk/src/VBox/Main/AudioAdapterImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/AudioAdapterImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/AudioAdapterImpl.cpp	(revision 25149)
@@ -178,5 +178,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -190,9 +190,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -212,5 +212,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -224,9 +224,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -291,5 +291,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -303,9 +303,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
Index: /trunk/src/VBox/Main/BIOSSettingsImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/BIOSSettingsImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/BIOSSettingsImpl.cpp	(revision 25149)
@@ -160,5 +160,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -172,9 +172,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -192,5 +192,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -204,9 +204,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -224,5 +224,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -236,9 +236,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -256,5 +256,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -271,9 +271,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -291,5 +291,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -302,9 +302,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -322,5 +322,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -334,9 +334,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -354,5 +354,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -366,9 +366,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -386,5 +386,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -398,9 +398,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -418,5 +418,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -430,9 +430,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
Index: /trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 25149)
@@ -1405,5 +1405,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mMachine is constant during life time, no need to lock */
@@ -1422,5 +1422,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1437,5 +1437,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mGuest is constant during life time, no need to lock */
@@ -1450,5 +1450,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mKeyboard is constant during life time, no need to lock */
@@ -1463,5 +1463,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mMouse is constant during life time, no need to lock */
@@ -1476,5 +1476,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mDisplay is constant during life time, no need to lock */
@@ -1489,5 +1489,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* we need a write lock because of the lazy mDebugger initialization*/
@@ -1511,5 +1511,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1526,5 +1526,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1541,5 +1541,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mDisplay is constant during life time, no need to lock */
@@ -1555,5 +1555,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* loadDataFromSavedState() needs a write lock */
@@ -1562,5 +1562,5 @@
     /* Read console data stored in the saved state file (if not yet done) */
     HRESULT rc = loadDataFromSavedState();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     SafeIfaceArray<ISharedFolder> sf(mSharedFolders);
@@ -1594,5 +1594,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1676,5 +1676,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1691,5 +1691,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* leave the lock before a VMR3* call (EMT will call us back)! */
@@ -1713,5 +1713,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1737,5 +1737,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     LogFlowThisFunc(("Sending PAUSE request...\n"));
@@ -1760,5 +1760,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1771,5 +1771,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     LogFlowThisFunc(("Sending RESUME request...\n"));
@@ -1799,5 +1799,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1813,5 +1813,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PPDMIBASE pBase;
@@ -1857,5 +1857,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PPDMIBASE pBase;
@@ -1904,5 +1904,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PPDMIBASE pBase;
@@ -1928,5 +1928,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1939,5 +1939,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PPDMIBASE pBase;
@@ -1969,5 +1969,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1987,5 +1987,5 @@
     {
         HRESULT rc = Pause();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2027,5 +2027,5 @@
          */
         rc = mControl->BeginSavingState(progress, stateFilePath.asOutParam());
-        CheckComRCBreakRC(rc);
+        if (FAILED(rc)) break;
 
         fBeganSavingState = true;
@@ -2107,5 +2107,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2125,5 +2125,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2137,5 +2137,5 @@
 
     rc = mControl->SetRemoveSavedState(aRemove);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /*
@@ -2164,5 +2164,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /*
@@ -2248,5 +2248,5 @@
 #ifdef VBOX_WITH_USB
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2260,5 +2260,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* Don't proceed unless we've found the usb controller. */
@@ -2275,5 +2275,5 @@
     /* Request the device capture */
     HRESULT rc = mControl->CaptureUSBDevice(aId);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return rc;
@@ -2291,5 +2291,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2356,5 +2356,5 @@
     SafeIfaceArray<IUSBDevice> devsvec;
     HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < devsvec.size(); ++i)
@@ -2362,5 +2362,5 @@
         Bstr address;
         rc = devsvec[i]->COMGETTER(Address)(address.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (address == aAddress)
         {
@@ -2391,5 +2391,5 @@
     SafeIfaceArray<IUSBDevice> devsvec;
     HRESULT rc = COMGETTER(USBDevices)(ComSafeArrayAsOutParam(devsvec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < devsvec.size(); ++i)
@@ -2397,5 +2397,5 @@
         Bstr id;
         rc = devsvec[i]->COMGETTER(Id)(id.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (id == aId)
         {
@@ -2423,5 +2423,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2450,5 +2450,5 @@
     sharedFolder.createObject();
     rc = sharedFolder->init(this, aName, aHostPath, aWritable);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* protect mpVM (if not NULL) */
@@ -2465,10 +2465,10 @@
         {
             rc = removeSharedFolder(aName);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
 
         /* second, create the given folder */
         rc = createSharedFolder(aName, SharedFolderData(aHostPath, aWritable));
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2490,5 +2490,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2510,5 +2510,5 @@
     ComObjPtr<SharedFolder> sharedFolder;
     HRESULT rc = findSharedFolder(aName, sharedFolder, true /* aSetError */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* protect mpVM (if not NULL) */
@@ -2522,5 +2522,5 @@
         /* first, remove the given folder */
         rc = removeSharedFolder(aName);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* first, remove the machine or the global folder if there is any */
@@ -2557,5 +2557,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2686,5 +2686,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2697,5 +2697,5 @@
     MachineState_T machineState = MachineState_Null;
     HRESULT rc = mControl->DeleteSnapshot(this, aId, &machineState, aProgress);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     setMachineStateLocally(machineState);
@@ -2706,5 +2706,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2717,5 +2717,5 @@
     MachineState_T machineState = MachineState_Null;
     HRESULT rc = mControl->RestoreSnapshot(this, aSnapshot, &machineState, aProgress);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     setMachineStateLocally(machineState);
@@ -2728,5 +2728,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
 #if 0 /** @todo r=bird,r=pritesh: must check that the interface id match correct or we might screw up with old code! */
@@ -2777,5 +2777,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -3036,5 +3036,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(pThis);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PVM pVM = pThis->mpVM;
@@ -3269,5 +3269,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* Get the properties we need from the adapter */
@@ -3408,5 +3408,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /*
@@ -3482,5 +3482,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(pThis);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     PVM pVM = pThis->mpVM;
@@ -3582,5 +3582,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* nothing to do so far */
@@ -3620,5 +3620,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* nothing to do so far */
@@ -3658,5 +3658,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* nothing to do so far */
@@ -3696,5 +3696,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     rc = doMediumChange(aMediumAttachment, !!aForce);
@@ -3822,5 +3822,5 @@
 //    /* protect mpVM */
 //    AutoVMCaller autoVMCaller(this);
-//    CheckComRCReturnRC(autoVMCaller.rc());
+//    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* notify console callbacks on success */
@@ -4043,5 +4043,5 @@
     /* protect mpVM (if not NULL) */
     AutoVMCallerWeak autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
@@ -4118,5 +4118,5 @@
     /* protect mpVM (if not NULL) */
     AutoVMCallerWeak autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
@@ -4198,5 +4198,5 @@
     /* protect mpVM (if not NULL) */
     AutoVMCallerWeak autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* Note: validity of mVMMDev which is bound to uninit() is guaranteed by
@@ -4576,5 +4576,5 @@
     Bstr logFolder;
     hrc = aMachine->COMGETTER(LogFolder)(logFolder.asOutParam());
-    CheckComRCReturnRC(hrc);
+    if (FAILED(hrc)) return hrc;
 
     Utf8Str logDir = logFolder;
@@ -4715,5 +4715,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4774,5 +4774,5 @@
     /* Read console data stored in the saved state file (if not yet done) */
     rc = loadDataFromSavedState();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* Check all types of shared folders and compose a single list */
@@ -4803,5 +4803,5 @@
     {
         rc = mMachine->COMGETTER(StateFilePath)(savedStateFile.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         ComAssertRet(!!savedStateFile, E_FAIL);
         int vrc = SSMR3ValidateFile(Utf8Str(savedStateFile).c_str(), false /* fChecksumIt */);
@@ -4815,10 +4815,10 @@
     BOOL fTeleporterEnabled;
     rc = mMachine->COMGETTER(TeleporterEnabled)(&fTeleporterEnabled);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 #if 0 /** @todo we should save it afterwards, but that isn't necessarily a good idea. Find a better place for this (VBoxSVC).  */
     if (fTeleporterEnabled)
     {
         rc = mMachine->COMSETTER(TeleporterEnabled)(FALSE);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 #endif
@@ -4837,5 +4837,5 @@
                                progressDesc,
                                fTeleporterEnabled /* aCancelable */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* setup task object and thread to carry out the operation
@@ -4863,5 +4863,5 @@
     ComPtr<ISnapshot> pCurrentSnapshot;
     rc = mMachine->COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     BOOL fCurrentSnapshotIsOnline = false;
@@ -4869,5 +4869,5 @@
     {
         rc = pCurrentSnapshot->COMGETTER(Online)(&fCurrentSnapshotIsOnline);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -4878,5 +4878,5 @@
         com::SafeIfaceArray<IMediumAttachment> atts;
         rc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         for (size_t i = 0;
@@ -4891,5 +4891,5 @@
                 ComPtr<IMedium> medium;
                 rc = atts[i]->COMGETTER(Medium)(medium.asOutParam());
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 /* save for later use on the powerup thread */
@@ -4899,5 +4899,5 @@
                 BOOL autoReset = FALSE;
                 rc = medium->COMGETTER(AutoReset)(&autoReset);
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 if (autoReset)
@@ -4905,5 +4905,5 @@
                     ComPtr<IProgress> resetProgress;
                     rc = medium->Reset(resetProgress.asOutParam());
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
 
                     /* save for later use on the powerup thread */
@@ -4917,5 +4917,5 @@
 
     rc = consoleInitReleaseLog(mMachine);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* pass the progress object to the caller if requested */
@@ -5423,7 +5423,7 @@
 
             rc = folder->COMGETTER(Name)(name.asOutParam());
-            CheckComRCBreakRC(rc);
+            if (FAILED(rc)) break;
             rc = folder->COMGETTER(HostPath)(hostPath.asOutParam());
-            CheckComRCBreakRC(rc);
+            if (FAILED(rc)) break;
             rc = folder->COMGETTER(Writable)(&writable);
 
@@ -5977,5 +5977,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     LogFlowThisFunc(("Proxying USB device '%s' {%RTuuid}...\n",
@@ -6096,5 +6096,5 @@
     /* protect mpVM */
     AutoVMCaller autoVMCaller(this);
-    CheckComRCReturnRC(autoVMCaller.rc());
+    if (FAILED(autoVMCaller.rc())) return autoVMCaller.rc();
 
     /* if the device is attached, then there must at least one USB hub. */
@@ -6427,5 +6427,5 @@
         ComPtr<INetworkAdapter> networkAdapter;
         rc = mMachine->GetNetworkAdapter(slot, networkAdapter.asOutParam());
-        CheckComRCBreakRC(rc);
+        if (FAILED(rc)) break;
 
         BOOL enabled = FALSE;
@@ -6840,5 +6840,5 @@
         {
             rc = console->mControl->LockMedia();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
@@ -6958,11 +6958,10 @@
                     {
                         rc = console->createSharedFolder((*it).first, (*it).second);
-                        CheckComRCBreakRC(rc);
+                        if (FAILED(rc)) break;
                     }
+                    if (FAILED(rc)) break;
 
                     /* enter the lock again */
                     alock.enter();
-
-                    CheckComRCBreakRC(rc);
                 }
 
@@ -6971,5 +6970,5 @@
                  */
                 rc = console->captureUSBDevices(pVM);
-                CheckComRCBreakRC(rc);
+                if (FAILED(rc)) break;
 
                 /* leave the lock before a lengthy operation */
Index: /trunk/src/VBox/Main/ConsoleImplTeleporter.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImplTeleporter.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ConsoleImplTeleporter.cpp	(revision 25149)
@@ -610,5 +610,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /*
@@ -906,5 +906,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock autoLock(this);
@@ -932,7 +932,7 @@
     ComObjPtr<Progress> ptrProgress;
     HRESULT hrc = ptrProgress.createObject();
-    CheckComRCReturnRC(hrc);
+    if (FAILED(hrc)) return hrc;
     hrc = ptrProgress->init(static_cast<IConsole *>(this), Bstr(tr("Teleporter")), TRUE /*aCancelable*/);
-    CheckComRCReturnRC(hrc);
+    if (FAILED(hrc)) return hrc;
 
     TeleporterStateSrc *pState = new TeleporterStateSrc(this, mpVM, ptrProgress, mMachineState);
Index: /trunk/src/VBox/Main/ConsoleVRDPServer.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ConsoleVRDPServer.cpp	(revision 25149)
@@ -765,5 +765,5 @@
 
             ULONG port = *(uint32_t *)pvBuffer;
-            
+
             server->mVRDPBindPort = port;
 
@@ -2172,9 +2172,9 @@
             return E_POINTER;                                             \
                                                                           \
-        AutoCaller autoCaller(this);                                     \
-        CheckComRCReturnRC(autoCaller.rc());                             \
+        AutoCaller autoCaller(this);                                      \
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
                                                                           \
         /* todo: Not sure if a AutoReadLock would be sufficient. */       \
-        AutoWriteLock alock(this);                                       \
+        AutoWriteLock alock(this);                                        \
                                                                           \
         uint32_t value;                                                   \
@@ -2195,9 +2195,9 @@
             return E_POINTER;                                             \
                                                                           \
-        AutoCaller autoCaller(this);                                     \
-        CheckComRCReturnRC(autoCaller.rc());                             \
+        AutoCaller autoCaller(this);                                      \
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
                                                                           \
         /* todo: Not sure if a AutoReadLock would be sufficient. */       \
-        AutoWriteLock alock(this);                                       \
+        AutoWriteLock alock(this);                                        \
                                                                           \
         _aType value;                                                     \
@@ -2218,9 +2218,9 @@
             return E_POINTER;                                             \
                                                                           \
-        AutoCaller autoCaller(this);                                     \
-        CheckComRCReturnRC(autoCaller.rc());                             \
+        AutoCaller autoCaller(this);                                      \
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();              \
                                                                           \
         /* todo: Not sure if a AutoReadLock would be sufficient. */       \
-        AutoWriteLock alock(this);                                       \
+        AutoWriteLock alock(this);                                        \
                                                                           \
         uint32_t cbOut = 0;                                               \
@@ -2232,5 +2232,5 @@
         {                                                                 \
             Bstr str("");                                                 \
-            str.cloneTo(a##_aName);                                      \
+            str.cloneTo(a##_aName);                                       \
             return S_OK;                                                  \
         }                                                                 \
@@ -2251,5 +2251,5 @@
         Bstr str(pchBuffer);                                              \
                                                                           \
-        str.cloneTo(a##_aName);                                          \
+        str.cloneTo(a##_aName);                                           \
                                                                           \
         RTMemTmpFree (pchBuffer);                                         \
Index: /trunk/src/VBox/Main/DHCPServerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/DHCPServerImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/DHCPServerImpl.cpp	(revision 25149)
@@ -115,5 +115,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -134,5 +134,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     mName.cloneTo(aName);
@@ -146,5 +146,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aEnabled = m.enabled;
@@ -156,5 +156,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -173,5 +173,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.IPAddress.cloneTo(aIPAddress);
@@ -185,5 +185,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.networkMask.cloneTo(aNetworkMask);
@@ -197,5 +197,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.lowerIP.cloneTo(aIPAddress);
@@ -209,5 +209,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.upperIP.cloneTo(aIPAddress);
@@ -224,5 +224,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
Index: /trunk/src/VBox/Main/DisplayImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/DisplayImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/DisplayImpl.cpp	(revision 25149)
@@ -224,5 +224,5 @@
                 return;
             }
-            
+
             pCtx->pu8PNG = (uint8_t *)pNew;
             pCtx->cbAllocated = cbNew;
@@ -373,5 +373,5 @@
                 }
 
-                png_destroy_write_struct(&png_ptr, info_ptr ? &info_ptr 
+                png_destroy_write_struct(&png_ptr, info_ptr ? &info_ptr
                                                             : (png_infopp)NULL);
             }
@@ -1247,5 +1247,5 @@
 }
 #endif /* VBOX_WITH_OLD_VBVA_LOCK */
-    
+
 /**
  * @thread EMT
@@ -1940,5 +1940,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1962,5 +1962,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1985,5 +1985,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2012,5 +2012,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2049,5 +2049,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2071,5 +2071,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2121,5 +2121,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2218,5 +2218,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2224,6 +2224,6 @@
     CHECK_CONSOLE_DRV (mpDrv);
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     HRESULT rc = S_OK;
@@ -2268,5 +2268,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2274,6 +2274,6 @@
     CHECK_CONSOLE_DRV (mpDrv);
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     HRESULT rc = S_OK;
@@ -2361,5 +2361,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2367,6 +2367,6 @@
     CHECK_CONSOLE_DRV (mpDrv);
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     /*
@@ -2427,5 +2427,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2433,6 +2433,6 @@
     CHECK_CONSOLE_DRV (mpDrv);
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     HRESULT rc = S_OK;
@@ -2481,5 +2481,5 @@
     //  milliseconds).
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is only valid for external framebuffers */
@@ -2517,5 +2517,5 @@
     //  milliseconds).
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is only valid for external framebuffers */
@@ -2646,5 +2646,5 @@
 
     AutoCaller autoCaller(that);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(that);
Index: /trunk/src/VBox/Main/GuestImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/GuestImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/GuestImpl.cpp	(revision 25149)
@@ -121,5 +121,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -139,5 +139,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -153,5 +153,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -167,5 +167,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -181,5 +181,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -195,5 +195,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -207,5 +207,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -229,5 +229,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -241,5 +241,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -266,5 +266,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* forward the information to the VMM device */
Index: /trunk/src/VBox/Main/GuestOSTypeImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/GuestOSTypeImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/GuestOSTypeImpl.cpp	(revision 25149)
@@ -131,5 +131,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mFamilyID is constant during life time, no need to lock */
@@ -144,5 +144,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mFamilyDescription is constant during life time, no need to lock */
@@ -157,5 +157,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mID is constant during life time, no need to lock */
@@ -170,5 +170,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mDescription is constant during life time, no need to lock */
@@ -183,5 +183,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mIs64Bit is constant during life time, no need to lock */
@@ -196,5 +196,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mRecommendedIOAPIC is constant during life time, no need to lock */
@@ -209,5 +209,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mRecommendedVirtEx is constant during life time, no need to lock */
@@ -222,5 +222,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mRAMSize is constant during life time, no need to lock */
@@ -235,5 +235,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mVRAMSize is constant during life time, no need to lock */
@@ -248,5 +248,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mHDDSize is constant during life time, no need to lock */
@@ -261,5 +261,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mNetworkAdapterType is constant during life time, no need to lock */
Index: /trunk/src/VBox/Main/HostImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HostImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/HostImpl.cpp	(revision 25149)
@@ -386,5 +386,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -510,5 +510,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -628,5 +628,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -909,10 +909,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     MultiResult rc = checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return m->pUSBProxyService->getDeviceCollection(ComSafeArrayOutArg(aUSBDevices));
@@ -936,10 +936,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoMultiWriteLock2 alock(this->lockHandle(), &m->treeLock);
 
     MultiResult rc = checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     SafeIfaceArray<IHostUSBDeviceFilter> collection(m->llUSBDeviceFilters);
@@ -1036,5 +1036,5 @@
     CheckComArgOutPointerValid(aSupported);
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1222,5 +1222,5 @@
     CheckComArgOutPointerValid(aSupported);
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1238,5 +1238,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1255,5 +1255,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1284,5 +1284,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1313,10 +1313,10 @@
     /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoMultiWriteLock2 alock(this->lockHandle(), &m->treeLock);
 
     MultiResult rc = checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr<HostUSBDeviceFilter> pFilter;
@@ -1373,10 +1373,10 @@
     /* Note: HostUSBDeviceFilter and USBProxyService also uses this lock. */
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoMultiWriteLock2 alock(this->lockHandle(), &m->treeLock);
 
     MultiResult rc = checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (!m->llUSBDeviceFilters.size())
@@ -1430,5 +1430,5 @@
     SafeIfaceArray<IMedium> drivevec;
     HRESULT rc = COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(drivevec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < drivevec.size(); ++i)
@@ -1437,7 +1437,7 @@
         Bstr name, location;
         rc = drive->COMGETTER(Name)(name.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         rc = drive->COMGETTER(Location)(location.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (name == aName || location == aName)
             return drive.queryInterfaceTo(aDrive);
@@ -1457,5 +1457,5 @@
     SafeIfaceArray<IMedium> drivevec;
     HRESULT rc = COMGETTER(FloppyDrives)(ComSafeArrayAsOutParam(drivevec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < drivevec.size(); ++i)
@@ -1464,5 +1464,5 @@
         Bstr name;
         rc = drive->COMGETTER(Name)(name.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (name == aName)
             return drive.queryInterfaceTo(aDrive);
@@ -1591,5 +1591,5 @@
     SafeIfaceArray<IHostUSBDevice> devsvec;
     HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < devsvec.size(); ++i)
@@ -1597,5 +1597,5 @@
         Bstr address;
         rc = devsvec[i]->COMGETTER(Address) (address.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (address == aAddress)
         {
@@ -1626,5 +1626,5 @@
     SafeIfaceArray<IHostUSBDevice> devsvec;
     HRESULT rc = COMGETTER(USBDevices) (ComSafeArrayAsOutParam(devsvec));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < devsvec.size(); ++i)
@@ -1632,5 +1632,5 @@
         Bstr id;
         rc = devsvec[i]->COMGETTER(Id) (id.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         if (id == aId)
         {
@@ -1658,5 +1658,5 @@
 #ifdef VBOX_WITH_USB
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoMultiWriteLock2 alock(this->lockHandle(), &m->treeLock);
@@ -1671,5 +1671,5 @@
         pFilter.createObject();
         rc = pFilter->init(this, f);
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
 
         m->llUSBDeviceFilters.push_back(pFilter);
@@ -1693,5 +1693,5 @@
 #ifdef VBOX_WITH_USB
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(&m->treeLock);
@@ -1724,5 +1724,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(&m->treeLock);
@@ -1736,5 +1736,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(&m->treeLock);
@@ -1766,5 +1766,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2327,5 +2327,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
Index: /trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp	(revision 25149)
@@ -167,5 +167,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     mInterfaceName.cloneTo(aInterfaceName);
@@ -185,5 +185,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     mGuid.toUtf16().cloneTo(aGuid);
@@ -197,5 +197,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aDhcpEnabled = m.dhcpEnabled;
@@ -216,5 +216,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     if (m.IPAddress == 0)
@@ -251,5 +251,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     if (m.networkMask == 0)
@@ -298,5 +298,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.IPV6Address.cloneTo(aIPV6Address);
@@ -316,5 +316,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aIPV6NetworkMaskPrefixLength = m.IPV6NetworkMaskPrefixLength;
@@ -334,5 +334,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     m.hardwareAddress.cloneTo(aHardwareAddress);
@@ -352,5 +352,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aType = m.mediumType;
@@ -370,5 +370,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aStatus = m.status;
@@ -388,5 +388,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aType = mIfType;
@@ -399,5 +399,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Utf8Str utf8Name("HostInterfaceNetworking-");
@@ -415,5 +415,5 @@
 #else
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     if (Bstr(aIPAddress).isEmpty())
@@ -482,5 +482,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     int rc = S_OK;
@@ -517,5 +517,5 @@
 #else
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     int rc = NetIfEnableDynamicIpConfig(mVBox, this);
@@ -535,5 +535,5 @@
 #else
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     int rc = NetIfDhcpRediscover(mVBox, this);
@@ -551,5 +551,5 @@
     HRESULT hrc;
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     mVBox = pVBox;
 
Index: /trunk/src/VBox/Main/KeyboardImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/KeyboardImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/KeyboardImpl.cpp	(revision 25149)
@@ -135,5 +135,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -170,5 +170,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -284,5 +284,5 @@
     if (!CFGMR3AreValuesValid (pCfgHandle, "Object\0"))
         return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
-    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
+    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
                     ("Configuration error: Not possible to attach anything to this driver!\n"),
                     VERR_PDM_DRVINS_NO_ATTACH);
@@ -358,7 +358,7 @@
     NULL,
     /* pfnDetach */
-    NULL, 
+    NULL,
     /* pfnPowerOff */
-    NULL, 
+    NULL,
     /* pfnSoftReset */
     NULL,
Index: /trunk/src/VBox/Main/MachineDebuggerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineDebuggerImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MachineDebuggerImpl.cpp	(revision 25149)
@@ -127,5 +127,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /** @todo */
@@ -142,5 +142,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /** @todo */
@@ -159,5 +159,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -184,5 +184,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -196,5 +196,5 @@
 
     Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING3_DISABLE : EMRAW_RING3_ENABLE;
@@ -219,5 +219,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -244,5 +244,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -256,5 +256,5 @@
 
     Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     EMRAWMODE rawModeFlag = aEnable ? EMRAW_RING0_DISABLE : EMRAW_RING0_ENABLE;
@@ -279,5 +279,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -304,5 +304,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -315,6 +315,6 @@
     }
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     PATMR3AllowPatching (pVM, aEnable);
@@ -334,5 +334,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -359,5 +359,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -370,6 +370,6 @@
     }
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     int vrc;
@@ -398,5 +398,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
 #ifdef LOG_ENABLED
@@ -423,5 +423,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -434,6 +434,6 @@
     }
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
 #ifdef LOG_ENABLED
@@ -459,5 +459,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -484,5 +484,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -509,5 +509,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -534,5 +534,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -562,5 +562,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -588,5 +588,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -599,6 +599,6 @@
     }
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     int vrc = TMR3SetWarpDrive (pVM, aPct);
@@ -625,10 +625,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    AutoReadLock alock(this);
-
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    AutoReadLock alock(this);
+
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     *aVm = (uintptr_t)pVM.raw();
@@ -722,10 +722,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
-    Console::SafeVMPtr pVM (mParent);
-    CheckComRCReturnRC(pVM.rc());
+    Console::SafeVMPtr pVM(mParent);
+    if (FAILED(pVM.rc())) return pVM.rc();
 
     HWACCMR3InjectNMI(pVM);
Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 25149)
@@ -701,5 +701,5 @@
 
     AutoLimitedCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mParent is constant during life time, no need to lock */
@@ -714,5 +714,5 @@
 
     AutoLimitedCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     LogFlowThisFunc(("ENTER\n"));
@@ -768,5 +768,5 @@
 
     AutoLimitedCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -800,5 +800,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -818,10 +818,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -836,5 +836,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -848,10 +848,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -866,5 +866,5 @@
 
     AutoLimitedCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -880,5 +880,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -894,5 +894,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* look up the object by Id to check it is valid */
@@ -900,5 +900,5 @@
     HRESULT rc = mParent->GetGuestOSType (aOSTypeId,
                                           guestOSType.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* when setting, always use the "etalon" value for consistency -- lookup
@@ -906,10 +906,10 @@
     Bstr osTypeId;
     rc = guestOSType->COMGETTER(Id) (osTypeId.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AutoWriteLock alock(this);
 
     rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -925,5 +925,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -937,9 +937,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     AutoWriteLock alock(this);
 
     int rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -955,5 +955,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -974,10 +974,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -992,5 +992,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1011,10 +1011,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1033,5 +1033,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1053,10 +1053,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1072,5 +1072,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1092,10 +1092,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1111,5 +1111,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1130,10 +1130,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1150,5 +1150,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1169,10 +1169,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1189,5 +1189,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1202,10 +1202,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1222,5 +1222,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1234,10 +1234,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /** @todo check validity! */
@@ -1256,5 +1256,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1268,10 +1268,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /** @todo check validity! */
@@ -1289,5 +1289,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1307,10 +1307,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -1326,5 +1326,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mBIOSSettings is constant during life time, no need to lock */
@@ -1340,5 +1340,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1363,10 +1363,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     switch(property)
@@ -1394,5 +1394,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1449,10 +1449,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     switch(aId)
@@ -1507,10 +1507,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     switch(aId)
@@ -1559,10 +1559,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* Invalidate all standard leafs. */
@@ -1583,5 +1583,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1614,10 +1614,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     switch(property)
@@ -1654,5 +1654,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1674,10 +1674,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (!mData->mCurrentSnapshot.isNull())
@@ -1721,5 +1721,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1738,5 +1738,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1758,5 +1758,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1772,8 +1772,8 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     MultiResult rc = mParent->host()->checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AutoReadLock alock(this);
@@ -1794,5 +1794,5 @@
 
     AutoLimitedCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1807,10 +1807,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (mData->mInitMode == Init_New)
@@ -1830,5 +1830,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1844,5 +1844,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1861,5 +1861,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1876,5 +1876,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1890,5 +1890,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1904,5 +1904,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1938,5 +1938,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1952,5 +1952,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1968,5 +1968,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1988,5 +1988,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2003,5 +2003,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2016,10 +2016,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -2035,5 +2035,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2056,10 +2056,10 @@
     CheckComArgNotNull(aPatterns);
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     try
@@ -2081,5 +2081,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2097,5 +2097,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2110,5 +2110,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2141,5 +2141,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2157,10 +2157,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -2176,5 +2176,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2189,10 +2189,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -2208,5 +2208,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2221,10 +2221,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mUserData.backup();
@@ -2250,10 +2250,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -2271,5 +2271,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2293,5 +2293,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::findHardDisk() and the corresponding other methods for
@@ -2302,5 +2302,5 @@
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /// @todo NEWMEDIA implicit machine registration
@@ -2319,5 +2319,5 @@
     ComObjPtr<StorageController> ctl;
     rc = getStorageControllerByName(aControllerName, ctl, true /* aSetError */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* check that the port and device are not out of range. */
@@ -2325,7 +2325,7 @@
     ULONG devicesPerPort;
     rc = ctl->COMGETTER(PortCount)(&portCount);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     rc = ctl->COMGETTER(MaxDevicesPerPortCount)(&devicesPerPort);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (   (aControllerPort < 0)
@@ -2371,5 +2371,5 @@
             /* find a hard disk by UUID */
             rc = mParent->findHardDisk(&uuid, NULL, true /* aSetError */, &medium);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
             break;
 
@@ -2398,5 +2398,5 @@
                     /* find a DVD image by UUID */
                     rc = mParent->findDVDImage(&uuid, NULL, true /* aSetError */, &medium);
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
                 }
             }
@@ -2431,5 +2431,5 @@
                     /* find a floppy image by UUID */
                     rc = mParent->findFloppyImage(&uuid, NULL, true /* aSetError */, &medium);
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
                 }
             }
@@ -2447,5 +2447,5 @@
 
     AutoCaller mediumCaller(medium);
-    CheckComRCReturnRC(mediumCaller.rc());
+    if (FAILED(mediumCaller.rc())) return mediumCaller.rc();
 
     AutoWriteLock mediumLock(medium);
@@ -2559,5 +2559,5 @@
                     medium = (*foundIt)->getMedium();
                     mediumCaller.attach(medium);
-                    CheckComRCReturnRC(mediumCaller.rc());
+                    if (FAILED(mediumCaller.rc())) return mediumCaller.rc();
                     mediumLock.attach(medium);
                     /* not implicit, doesn't require association with this VM */
@@ -2633,5 +2633,5 @@
                 medium = base;
                 mediumCaller.attach(medium);
-                CheckComRCReturnRC(mediumCaller.rc());
+                if (FAILED(mediumCaller.rc())) return mediumCaller.rc();
                 mediumLock.attach(medium);
             }
@@ -2644,9 +2644,9 @@
                         BstrFmt("%ls"RTPATH_SLASH_STR,
                                  mUserData->mSnapshotFolderFull.raw()).raw());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* make sure the hard disk is not modified before createDiffStorage() */
         rc = medium->LockRead(NULL);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* will leave the lock before the potentially lengthy operation, so
@@ -2667,10 +2667,10 @@
         medium->UnlockRead(NULL);
 
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* use the created diff for the actual attachment */
         medium = diff;
         mediumCaller.attach(medium);
-        CheckComRCReturnRC(mediumCaller.rc());
+        if (FAILED(mediumCaller.rc())) return mediumCaller.rc();
         mediumLock.attach(medium);
     }
@@ -2680,5 +2680,5 @@
     attachment.createObject();
     rc = attachment->init(this, medium, aControllerName, aControllerPort, aDevice, aType, indirect);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (associate && !medium.isNull())
@@ -2688,5 +2688,5 @@
         /* here we can fail because of Deleting, or being in process of
          * creating a Diff */
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2707,10 +2707,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL);
@@ -2756,5 +2756,5 @@
         setMachineState(oldState);
 
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2782,10 +2782,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AssertReturn(mData->mMachineState != MachineState_Saved, E_FAIL);
@@ -2833,5 +2833,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2879,5 +2879,5 @@
                     rc = mParent->findDVDImage(&uuid, NULL, true /* aDoSetError */, &medium);
             }
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
             break;
         case DeviceType_Floppy:
@@ -2904,5 +2904,5 @@
                     rc = mParent->findFloppyImage(&uuid, NULL, true /* aDoSetError */, &medium);
             }
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
             break;
         default:
@@ -2969,5 +2969,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2995,5 +2995,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3010,5 +3010,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3025,5 +3025,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3039,6 +3039,6 @@
         return E_POINTER;
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock (this);
@@ -3067,6 +3067,6 @@
     CheckComArgOutPointerValid(aValue);
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* start with nothing found */
@@ -3094,5 +3094,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC (autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Utf8Str strKey(aKey);
@@ -3150,5 +3150,5 @@
         {
             HRESULT rc = checkStateDependency(MutableStateDep);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
         }
 
@@ -3161,5 +3161,5 @@
         /* save settings on success */
         HRESULT rc = saveSettings();
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -3174,5 +3174,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* saveSettings() needs mParent lock */
@@ -3182,5 +3182,5 @@
      * the VM is saved */
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* the settings file path may never be null */
@@ -3194,10 +3194,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /*
@@ -3213,10 +3213,10 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (mData->mRegistered)
@@ -3287,5 +3287,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3306,5 +3306,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3332,10 +3332,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr<SharedFolder> sharedFolder;
@@ -3348,5 +3348,5 @@
     sharedFolder.createObject();
     rc = sharedFolder->init(getMachine(), aName, aHostPath, aWritable);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -3365,14 +3365,14 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr<SharedFolder> sharedFolder;
     rc = findSharedFolder (aName, sharedFolder, true /* aSetError */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mHWData.backup();
@@ -3457,5 +3457,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3543,10 +3543,10 @@
 
         AutoCaller autoCaller(this);
-        CheckComRCReturnRC(autoCaller.rc());
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
         AutoWriteLock alock(this);
 
         rc = checkStateDependency(MutableStateDep);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         rc = S_OK;
@@ -3676,5 +3676,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3756,5 +3756,5 @@
 
     HRESULT rc = getMediumAttachmentsOfController(aName, atts);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     SafeIfaceArray<IMediumAttachment> attachments(atts);
@@ -3776,5 +3776,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3809,10 +3809,10 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* try to find one with the name first. */
@@ -3842,5 +3842,5 @@
 
     rc = ctrl->init(this, aName, aConnectionType, ulInstance);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mStorageControllers.backup();
@@ -3862,5 +3862,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3879,5 +3879,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3904,14 +3904,14 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
 
     HRESULT rc = checkStateDependency(MutableStateDep);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr<StorageController> ctrl;
     rc = getStorageControllerByName (aName, ctrl, true /* aSetError */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* We can remove the controller only if there is no device attached. */
@@ -4069,5 +4069,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4102,5 +4102,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4160,5 +4160,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4193,5 +4193,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -4346,5 +4346,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4576,5 +4576,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4815,5 +4815,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -5181,5 +5181,5 @@
     {
         rc = saveSettings();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -5231,5 +5231,5 @@
 
     HRESULT rc = checkStateDependency(aDepType);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     {
@@ -5725,5 +5725,5 @@
         rc = mParent->GetGuestOSType(mUserData->mOSTypeId,
                                      guestOSType.asOutParam());
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         // stateFile (optional)
@@ -5744,5 +5744,5 @@
         /* snapshotFolder (optional) */
         rc = COMSETTER(SnapshotFolder)(Bstr(mData->m_pMachineConfigFile->strSnapshotFolder));
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* currentStateModified (optional, default is true) */
@@ -5775,14 +5775,14 @@
                               mData->m_pMachineConfigFile->uuidCurrentSnapshot,
                               NULL);        // no parent == first snapshot
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
         /* Hardware node (required) */
         rc = loadHardware(mData->m_pMachineConfigFile->hardwareMachine);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* Load storage controllers */
         rc = loadStorageControllers(mData->m_pMachineConfigFile->storageMachine, aRegistered);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /*
@@ -5858,5 +5858,5 @@
                                 data.uuid,
                                 strStateFile);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* create a snapshot object */
@@ -5871,5 +5871,5 @@
                          pSnapshotMachine,
                          aParentSnapshot);
-    CheckComRCReturnRC (rc);
+    if (FAILED(rc)) return rc;
 
     /* memorize the first snapshot if necessary */
@@ -5893,5 +5893,5 @@
                           aCurSnapshotId,
                           pSnapshot);       // parent = the one we created above
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -5989,14 +5989,14 @@
         /* RemoteDisplay */
         rc = mVRDPServer->loadSettings(data.vrdpSettings);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 #endif
 
         /* BIOS */
         rc = mBIOSSettings->loadSettings(data.biosSettings);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         /* USB Controller */
         rc = mUSBController->loadSettings(data.usbController);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         // network adapters
@@ -6010,5 +6010,5 @@
             AssertBreak(nic.ulSlot < RT_ELEMENTS(mNetworkAdapters));
             rc = mNetworkAdapters[nic.ulSlot]->loadSettings(nic);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
         }
 
@@ -6022,5 +6022,5 @@
             AssertBreak(s.ulSlot < RT_ELEMENTS(mSerialPorts));
             rc = mSerialPorts[s.ulSlot]->loadSettings(s);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
         }
 
@@ -6034,10 +6034,10 @@
             AssertBreak(p.ulSlot < RT_ELEMENTS(mParallelPorts));
             rc = mParallelPorts[p.ulSlot]->loadSettings(p);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
         }
 
         /* AudioAdapter */
         rc = mAudioAdapter->loadSettings(data.audioAdapter);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         for (settings::SharedFoldersList::const_iterator it = data.llSharedFolders.begin();
@@ -6047,5 +6047,5 @@
             const settings::SharedFolder &sf = *it;
             rc = CreateSharedFolder(Bstr(sf.strName), Bstr(sf.strHostPath), sf.fWritable);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
         }
 
@@ -6118,13 +6118,13 @@
                         ctlData.storageBus,
                         ctlData.ulInstance);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         mStorageControllers->push_back(pCtl);
 
         rc = pCtl->COMSETTER(ControllerType)(ctlData.controllerType);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         rc = pCtl->COMSETTER(PortCount)(ctlData.ulPortCount);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         /* Set IDE emulation settings (only for AHCI controller). */
@@ -6144,5 +6144,5 @@
                                 aRegistered,
                                 aSnapshotId);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -6349,5 +6349,5 @@
                                dev.lDevice,
                                dev.deviceType);
-        CheckComRCBreakRC(rc);
+        if (FAILED(rc)) break;
 
         /* associate the medium with this machine and snapshot */
@@ -6481,5 +6481,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -6666,5 +6666,5 @@
         }
 
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -6770,5 +6770,5 @@
     bool isNew = false;
     rc = prepareSaveSettings(isRenamed, isNew);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     try
@@ -6816,12 +6816,12 @@
 
         rc = saveHardware(mData->m_pMachineConfigFile->hardwareMachine);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         rc = saveStorageControllers(mData->m_pMachineConfigFile->storageMachine);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         // save snapshots
         rc = saveAllSnapshots();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         // now spit it all out
@@ -6882,5 +6882,5 @@
 
             rc = mData->mFirstSnapshot->saveSnapshot(snap, false /*aAttrsOnly*/);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
@@ -6969,14 +6969,14 @@
         /* VRDP settings (optional) */
         rc = mVRDPServer->saveSettings(data.vrdpSettings);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 #endif
 
         /* BIOS (required) */
         rc = mBIOSSettings->saveSettings(data.biosSettings);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* USB Controller (required) */
         rc = mUSBController->saveSettings(data.usbController);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* Network adapters (required) */
@@ -6989,5 +6989,5 @@
             nic.ulSlot = slot;
             rc = mNetworkAdapters[slot]->saveSettings(nic);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             data.llNetworkAdapters.push_back(nic);
@@ -7003,5 +7003,5 @@
             s.ulSlot = slot;
             rc = mSerialPorts[slot]->saveSettings(s);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
 
             data.llSerialPorts.push_back(s);
@@ -7017,5 +7017,5 @@
             p.ulSlot = slot;
             rc = mParallelPorts[slot]->saveSettings(p);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
 
             data.llParallelPorts.push_back(p);
@@ -7024,5 +7024,5 @@
         /* Audio adapter */
         rc = mAudioAdapter->saveSettings(data.audioAdapter);
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
 
         /* Shared folders */
@@ -7138,5 +7138,5 @@
 
     HRESULT rc = getMediumAttachmentsOfController(Bstr(aStorageController->name()), atts);
-    CheckComRCReturnRC (rc);
+    if (FAILED(rc)) return rc;
 
     data.llAttachedDevices.clear();
@@ -7185,5 +7185,5 @@
         return S_OK;
 
-    AutoCaller autoCaller (this);
+    AutoCaller autoCaller(this);
     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
 
@@ -7304,5 +7304,5 @@
                     Assert(pHD);
                     rc = pHD->LockRead (NULL);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
                     lockedMedia.push_back(pHD);
                 }
@@ -7363,5 +7363,5 @@
                             BstrFmt("%ls"RTPATH_SLASH_STR,
                                     mUserData->mSnapshotFolderFull.raw()).raw());
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             /* leave the lock before the potentially lengthy operation */
@@ -7388,7 +7388,7 @@
             }
 
+            if (FAILED(rc)) throw rc;
+
             alock.enter();
-
-            CheckComRCThrowRC(rc);
 
             rc = diff->attachTo(mData->mUuid);
@@ -7405,5 +7405,5 @@
                                   DeviceType_HardDisk,
                                   true /* aImplicit */);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             mMediaData->mAttachments.push_back(attachment);
@@ -8905,5 +8905,5 @@
     /* if captureDeviceForVM() fails, it must have set extended error info */
     MultiResult rc = mParent->host()->checkUSBProxyService();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     USBProxyService *service = mParent->host()->usbProxyService();
@@ -9014,5 +9014,5 @@
      *  informs us it is closed right after we've been uninitialized -- it's ok.
      */
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* get IInternalSessionControl interface */
@@ -9344,5 +9344,5 @@
          */
         AutoCaller autoCaller(this);
-        CheckComRCReturnRC(autoCaller.rc());
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
         AutoWriteLock alock(this);
@@ -9740,5 +9740,5 @@
     /* This notification may happen after the machine object has been
      * uninitialized (the session was closed), so don't assert. */
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComPtr<IInternalSessionControl> directControl;
@@ -9772,5 +9772,5 @@
     /* This notification may happen after the machine object has been
      * uninitialized (the session was closed), so don't assert. */
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComPtr<IInternalSessionControl> directControl;
@@ -9903,5 +9903,5 @@
                 {
                     rc = medium->RefreshState(&mediumState);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
 
                     if (mediumState == MediumState_Inaccessible)
@@ -9909,9 +9909,9 @@
                         Bstr error;
                         rc = medium->COMGETTER(LastAccessError)(error.asOutParam());
-                        CheckComRCThrowRC(rc);
+                        if (FAILED(rc)) throw rc;
 
                         Bstr loc;
                         rc = medium->COMGETTER(Location)(loc.asOutParam());
-                        CheckComRCThrowRC(rc);
+                        if (FAILED(rc)) throw rc;
 
                         /* collect multiple errors */
@@ -9935,5 +9935,5 @@
                         /* HardDisk and Floppy medium must be locked for writing */
                         rc = medium->LockWrite(NULL);
-                        CheckComRCThrowRC(rc);
+                        if (FAILED(rc)) throw rc;
                     }
                     else
@@ -9941,5 +9941,5 @@
                         /* DVD medium must be locked for reading */
                         rc = medium->LockRead(NULL);
-                        CheckComRCThrowRC(rc);
+                        if (FAILED(rc)) throw rc;
                     }
 
@@ -9953,5 +9953,5 @@
                 {
                     rc = medium->LockRead(NULL);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
 
                     mData->mSession.mLockedMedia.push_back(
@@ -9968,6 +9968,8 @@
         }
 
+        /* @todo r=dj is this correct? first restoring the eik and then throwing? */
         eik.restore();
-        CheckComRCThrowRC((HRESULT)mrc);
+        HRESULT rc2 = (HRESULT)mrc;
+        if (FAILED(rc2)) throw rc2;
     }
     catch (HRESULT aRC)
Index: /trunk/src/VBox/Main/MediumAttachmentImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumAttachmentImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MediumAttachmentImpl.cpp	(revision 25149)
@@ -180,5 +180,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -197,5 +197,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* m->controller is constant during life time, no need to lock */
@@ -213,5 +213,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* m->port is constant during life time, no need to lock */
@@ -229,5 +229,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* m->device is constant during life time, no need to lock */
@@ -245,5 +245,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* m->type is constant during life time, no need to lock */
@@ -261,5 +261,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock lock(this);
Index: /trunk/src/VBox/Main/MediumFormatImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumFormatImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MediumFormatImpl.cpp	(revision 25149)
@@ -175,6 +175,6 @@
     CheckComArgOutPointerValid(aId);
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -188,6 +188,6 @@
     CheckComArgOutPointerValid(aName);
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -203,6 +203,6 @@
         return E_POINTER;
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -221,6 +221,6 @@
     CheckComArgOutPointerValid(aCaps);
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* m.capabilities is const, no need to lock */
@@ -249,6 +249,6 @@
     CheckComArgSafeArrayNotNull(aDefaults);
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
Index: /trunk/src/VBox/Main/MediumImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MediumImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MediumImpl.cpp	(revision 25149)
@@ -405,5 +405,5 @@
     {
         HRESULT rc = aMedium->addCaller();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         AutoWriteLock alock(aMedium);
@@ -423,5 +423,5 @@
         MediumState_T m;
         rc = aMedium->RefreshState(&m);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         /* go to Deleting */
         switch (m)
@@ -443,5 +443,5 @@
             {
                 rc = aMedium->mParent->addCaller();
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 mParent = aMedium->mParent;
@@ -457,5 +457,5 @@
                 ComObjPtr<Medium> pMedium = *it;
                 rc = pMedium->addCaller();
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 rc = pMedium->LockWrite(NULL);
@@ -476,5 +476,5 @@
     {
         HRESULT rc = aMedium->addCaller();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         AutoWriteLock alock(aMedium);
@@ -506,5 +506,5 @@
     {
         HRESULT rc = aMedium->addCaller();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         AutoWriteLock alock(aMedium);
@@ -662,5 +662,5 @@
     {
         HRESULT rc = aMedium->addCaller();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         push_front(aMedium);
@@ -686,5 +686,5 @@
             {
                 rc = (*it)->RefreshState(&mediumState);
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 if (mediumState == MediumState_Inaccessible)
@@ -692,9 +692,9 @@
                     Bstr error;
                     rc = (*it)->COMGETTER(LastAccessError)(error.asOutParam());
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
 
                     Bstr loc;
                     rc = (*it)->COMGETTER(Location)(loc.asOutParam());
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
 
                     /* collect multiple errors */
@@ -712,9 +712,10 @@
 
             rc = (*it)->LockRead(&mediumState);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
 
         eik.restore();
-        CheckComRCReturnRC((HRESULT)mrc);
+        HRESULT rc2 = (HRESULT)mrc;
+        if (FAILED(rc2)) return rc2;
 
         return S_OK;
@@ -740,5 +741,5 @@
             {
                 rc = (*it)->RefreshState(&mediumState);
-                CheckComRCReturnRC(rc);
+                if (FAILED(rc)) return rc;
 
                 if (mediumState == MediumState_Inaccessible)
@@ -746,9 +747,9 @@
                     Bstr error;
                     rc = (*it)->COMGETTER(LastAccessError)(error.asOutParam());
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
 
                     Bstr loc;
                     rc = (*it)->COMGETTER(Location)(loc.asOutParam());
-                    CheckComRCReturnRC(rc);
+                    if (FAILED(rc)) return rc;
 
                     /* collect multiple errors */
@@ -772,5 +773,6 @@
 
         eik.restore();
-        CheckComRCReturnRC((HRESULT) mrc);
+        HRESULT rc2 = (HRESULT)mrc;
+        if (FAILED(rc2)) return rc2;
 
         return S_OK;
@@ -900,15 +902,15 @@
 
     rc = setFormat(aFormat);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (m->formatObj->capabilities() & MediumFormatCapabilities_File)
     {
         rc = setLocation(aLocation);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
     else
     {
         rc = setLocation(aLocation);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /// @todo later we may want to use a pfnComposeLocation backend info
@@ -1006,5 +1008,5 @@
     else
         rc = setLocation(aLocation, "RAW");
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* save the new uuid values, will be used by queryInfo() */
@@ -1103,5 +1105,5 @@
         AssertReturn(!data.strFormat.isEmpty(), E_FAIL);
         rc = setFormat(Bstr(data.strFormat));
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
     else
@@ -1112,5 +1114,5 @@
         else
             rc = setFormat(Bstr("RAW"));
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1138,5 +1140,5 @@
     /* required */
     rc = setLocation(data.strLocation);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (aDeviceType == DeviceType_HardDisk)
@@ -1164,5 +1166,6 @@
     /* load all children */
     for (settings::MediaList::const_iterator it = data.llChildren.begin();
-         it != data.llChildren.end(); ++ it)
+         it != data.llChildren.end();
+         ++it)
     {
         const settings::Medium &med = *it;
@@ -1174,8 +1177,8 @@
                        aDeviceType,
                        med);              // child data
-        CheckComRCBreakRC(rc);
+        if (FAILED(rc)) break;
 
         rc = mVirtualBox->registerHardDisk(pHD, false /* aSaveRegistry */);
-        CheckComRCBreakRC(rc);
+        if (FAILED(rc)) break;
     }
 
@@ -1239,7 +1242,7 @@
     m->hostDrive = true;
     HRESULT rc = setFormat(Bstr("RAW"));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     rc = setLocation(aLocation);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     m->strDescription = aDescription;
 
@@ -1317,5 +1320,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1331,5 +1334,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1348,5 +1351,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1364,5 +1367,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1378,5 +1381,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1392,5 +1395,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1413,5 +1416,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1427,5 +1430,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1441,5 +1444,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1455,5 +1458,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1470,5 +1473,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, m->format is const */
@@ -1484,5 +1487,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1496,5 +1499,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -1567,5 +1570,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* we access mParent */
@@ -1583,5 +1586,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* we access children */
@@ -1612,5 +1615,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* isRadOnly() will do locking */
@@ -1627,5 +1630,5 @@
     {
         AutoCaller autoCaller(this);
-        CheckComRCReturnRC(autoCaller.rc());
+        if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
         AutoReadLock alock(this);
@@ -1656,5 +1659,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1671,5 +1674,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -1695,5 +1698,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1713,5 +1716,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1741,5 +1744,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* queryInfo() locks this for writing. */
@@ -1773,5 +1776,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -1824,5 +1827,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1879,5 +1882,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1923,5 +1926,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1970,5 +1973,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2004,5 +2007,5 @@
 {
     AutoMayUninitSpan mayUninitSpan(this);
-    CheckComRCReturnRC(mayUninitSpan.rc());
+    if (FAILED(mayUninitSpan.rc())) return mayUninitSpan.rc();
 
     if (mayUninitSpan.alreadyInProgress())
@@ -2039,5 +2042,5 @@
     /* perform extra media-dependent close checks */
     HRESULT rc = canClose();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (wasCreated)
@@ -2047,5 +2050,5 @@
          * failure to do so) */
         rc = unregisterWithVirtualBox();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2062,5 +2065,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2084,5 +2087,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -2122,5 +2125,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -2158,5 +2161,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -2202,5 +2205,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2234,5 +2237,5 @@
           : BstrFmt(tr("Creating dynamic hard disk storage unit '%s'"), m->strLocationFull.raw()),
         TRUE /* aCancelable */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* setup task object and thread to carry out the operation
@@ -2246,5 +2249,5 @@
 
     rc = task->startThread();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* go to Creating state on success */
@@ -2265,5 +2268,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr <Progress> progress;
@@ -2287,9 +2290,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<Medium> diff;
     HRESULT rc = mVirtualBox->cast(aTarget, diff);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AutoWriteLock alock(this);
@@ -2303,5 +2306,5 @@
      * created */
     rc = LockRead(NULL);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr <Progress> progress;
@@ -2326,5 +2329,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ReturnComNotImplemented();
@@ -2340,14 +2343,14 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr <Medium> target;
     HRESULT rc = mVirtualBox->cast(aTarget, target);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     ComObjPtr <Medium> parent;
     if (aParent)
     {
         rc = mVirtualBox->cast(aParent, parent);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -2374,8 +2377,8 @@
         {
             rc = srcChain->addImage(hd);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
         rc = srcChain->lockImagesRead();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* Build the parent chain and lock images in the proper order. */
@@ -2389,5 +2392,5 @@
         {
             rc = parentChain->addImage(hd);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
         if (target->m->state == MediumState_Created)
@@ -2396,12 +2399,12 @@
              * contains the target image, and it gets locked for writing. */
             rc = parentChain->addImage(target);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
             rc = parentChain->lockImagesReadAndLastWrite();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
         else
         {
             rc = parentChain->lockImagesRead();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
@@ -2411,5 +2414,5 @@
                     target->m->strLocationFull.raw()),
             TRUE /* aCancelable */);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* setup task object and thread to carry out the operation
@@ -2424,5 +2427,5 @@
 
         rc = task->startThread();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         if (target->m->state == MediumState_NotCreated)
@@ -2454,5 +2457,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2476,8 +2479,8 @@
         {
             rc = imgChain->addImage(hd);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
         rc = imgChain->lockImagesReadAndLastWrite();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         progress.createObject();
@@ -2485,5 +2488,5 @@
              BstrFmt(tr("Compacting hard disk '%s'"), m->strLocationFull.raw()),
              TRUE /* aCancelable */);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* setup task object and thread to carry out the operation
@@ -2496,5 +2499,5 @@
 
         rc = task->startThread();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* task is now owned (or already deleted) by taskThread() so release it */
@@ -2520,5 +2523,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     NOREF(aLogicalSize);
@@ -2532,5 +2535,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -2544,8 +2547,8 @@
 
     HRESULT rc = canClose();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = LockWrite(NULL);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr <Progress> progress;
@@ -2558,5 +2561,5 @@
                      m->strLocationFull.raw()),
             FALSE /* aCancelable */);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* setup task object and thread to carry out the operation
@@ -2567,5 +2570,5 @@
 
         rc = task->startThread();
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* task is now owned (or already deleted) by taskThread() so release it */
@@ -2615,5 +2618,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -3009,5 +3012,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -3680,5 +3683,5 @@
     else
         rc = LockWrite(NULL);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* Copies of the input state fields which are not read-only,
@@ -3927,5 +3930,5 @@
     else
         rc = UnlockWrite(NULL);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return rc;
@@ -4088,5 +4091,5 @@
 
     HRESULT rc = canClose();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* go to Deleting state before leaving the lock */
@@ -4109,5 +4112,5 @@
     m->state = MediumState_Created;
 
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComObjPtr <Progress> progress;
@@ -4126,5 +4129,5 @@
                          m->strLocationFull.raw()),
                 FALSE /* aCancelable */);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
     }
@@ -4143,5 +4146,5 @@
     {
         rc = task->startThread();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* go to Deleting state before leaving the lock */
@@ -4205,8 +4208,8 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoCaller targetCaller(aTarget);
-    CheckComRCReturnRC(targetCaller.rc());
+    if (FAILED(targetCaller.rc())) return targetCaller.rc();
 
     AutoMultiWriteLock2 alock(this, aTarget);
@@ -4264,5 +4267,5 @@
                          aTarget->m->strLocationFull.raw()),
                 TRUE /* aCancelable */);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
     }
@@ -4291,5 +4294,5 @@
     {
         rc = task->startThread();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* go to Creating state before leaving the lock */
@@ -4397,5 +4400,5 @@
             else
                 rc = chain->addIntermediate(last);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
 
             if (last == first)
@@ -4489,5 +4492,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = S_OK;
@@ -4511,5 +4514,5 @@
                         aChain->target()->getName().raw()),
                 TRUE /* aCancelable */);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
     }
@@ -4535,5 +4538,5 @@
     {
         rc = task->startThread();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -4938,5 +4941,5 @@
                     /* ensure the directory exists */
                     rc = VirtualBox::ensureFilePathExists(location);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
 
                     PDMMEDIAGEOMETRY geo = { 0 }; /* auto-detect */
@@ -5055,5 +5058,5 @@
                     /* ensure the target directory exists */
                     rc = VirtualBox::ensureFilePathExists(targetLocation);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
 
                     /** @todo add VD_IMAGE_FLAGS_DIFF to the image flags, to
@@ -5525,5 +5528,5 @@
                     /* ensure the target directory exists */
                     rc = VirtualBox::ensureFilePathExists(targetLocation);
-                    CheckComRCThrowRC(rc);
+                    if (FAILED(rc)) throw rc;
 
                     PVBOXHDD targetHdd;
Index: /trunk/src/VBox/Main/MouseImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MouseImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/MouseImpl.cpp	(revision 25149)
@@ -139,5 +139,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -169,5 +169,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -203,5 +203,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -266,5 +266,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -413,5 +413,5 @@
     if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0"))
         return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
-    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
+    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
                     ("Configuration error: Not possible to attach anything to this driver!\n"),
                     VERR_PDM_DRVINS_NO_ATTACH);
@@ -485,7 +485,7 @@
     NULL,
     /* pfnDetach */
-    NULL, 
+    NULL,
     /* pfnPowerOff */
-    NULL, 
+    NULL,
     /* pfnSoftReset */
     NULL,
Index: /trunk/src/VBox/Main/NetworkAdapterImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/NetworkAdapterImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/NetworkAdapterImpl.cpp	(revision 25149)
@@ -181,5 +181,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -193,9 +193,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -240,5 +240,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -254,5 +254,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -266,9 +266,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -293,5 +293,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -307,9 +307,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -390,5 +390,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -404,5 +404,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -420,9 +420,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -447,5 +447,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -459,9 +459,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -495,5 +495,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -511,9 +511,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -538,5 +538,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -550,9 +550,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -577,5 +577,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -589,9 +589,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -616,5 +616,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -627,9 +627,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -654,5 +654,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -666,9 +666,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -694,9 +694,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -734,9 +734,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -776,9 +776,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -826,9 +826,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -868,9 +868,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
-
-    /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+
+    /* the machine needs to be mutable */
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -926,5 +926,5 @@
     /* MAC address (can be null) */
     rc = COMSETTER(MACAddress)(Bstr(data.strMACAddress));
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     /* cable (required) */
     mData->mCableConnected = data.fCableConnected;
@@ -942,12 +942,12 @@
                 mData->mNATNetwork = "";
             rc = AttachToNAT();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         break;
 
         case NetworkAttachmentType_Bridged:
             rc = COMSETTER(HostInterface)(Bstr(data.strName));
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
             rc = AttachToBridgedInterface();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         break;
 
@@ -957,5 +957,5 @@
 
             rc = AttachToInternalNetwork();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         break;
 
@@ -963,13 +963,13 @@
 #if defined(VBOX_WITH_NETFLT)
             rc = COMSETTER(HostInterface)(Bstr(data.strName));
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
 #endif
             rc = AttachToHostOnlyInterface();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         break;
 
         case NetworkAttachmentType_Null:
             rc = Detach();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         break;
     }
Index: /trunk/src/VBox/Main/ParallelPortImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ParallelPortImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ParallelPortImpl.cpp	(revision 25149)
@@ -201,5 +201,5 @@
     Bstr path(data.strPath);
     HRESULT rc = checkSetPath (path);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     mData->mPath = path;
 
@@ -316,5 +316,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -330,9 +330,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -364,5 +364,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -378,5 +378,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -398,9 +398,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -432,5 +432,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -452,9 +452,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -486,5 +486,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -515,9 +515,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -530,5 +530,5 @@
     {
         HRESULT rc = checkSetPath (aPath);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         mData.backup();
Index: /trunk/src/VBox/Main/Performance.cpp
===================================================================
--- /trunk/src/VBox/Main/Performance.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/Performance.cpp	(revision 25149)
@@ -295,11 +295,11 @@
 }
 
-void CircularBuffer::init(ULONG length)
+void CircularBuffer::init(ULONG ulLength)
 {
     if (mData)
         RTMemFree(mData);
-    mLength = length;
+    mLength = ulLength;
     if (mLength)
-        mData = (ULONG *)RTMemAllocZ(length * sizeof(ULONG));
+        mData = (ULONG*)RTMemAllocZ(ulLength * sizeof(ULONG));
     else
         mData = NULL;
Index: /trunk/src/VBox/Main/PerformanceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/PerformanceImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/PerformanceImpl.cpp	(revision 25149)
@@ -174,5 +174,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -226,5 +226,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     pm::Filter filter (ComSafeArrayInArg (metricNames),
@@ -265,5 +265,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     pm::Filter filter (ComSafeArrayInArg (metricNames),
@@ -314,5 +314,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     pm::Filter filter (ComSafeArrayInArg (metricNames),
@@ -351,5 +351,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     pm::Filter filter (ComSafeArrayInArg (metricNames),
@@ -394,5 +394,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     pm::Filter filter (ComSafeArrayInArg (metricNames),
Index: /trunk/src/VBox/Main/ProgressImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ProgressImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/ProgressImpl.cpp	(revision 25149)
@@ -210,5 +210,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mId is constant during life time, no need to lock */
@@ -223,5 +223,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mDescription is constant during life time, no need to lock */
@@ -236,5 +236,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mInitiator/mParent are constant during life time, no need to lock */
@@ -257,5 +257,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -309,5 +309,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -342,5 +342,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     checkForAutomaticTimeout();
@@ -375,5 +375,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -389,5 +389,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -403,5 +403,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -421,5 +421,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -439,5 +439,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -453,5 +453,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -467,5 +467,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -481,5 +481,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -496,5 +496,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -514,5 +514,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -599,5 +599,5 @@
 {
     HRESULT rc = ProgressBase::FinalConstruct();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mCompletedSem = NIL_RTSEMEVENTMULTI;
@@ -698,5 +698,5 @@
 #endif
                                       aInitiator, aDescription, aId);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mCancelable = aCancelable;
@@ -750,5 +750,5 @@
 
     rc = ProgressBase::protectedInit (autoInitSpan);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mCancelable = aCancelable;
@@ -821,5 +821,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -883,5 +883,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -941,5 +941,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1237,5 +1237,5 @@
 {
     HRESULT rc = ProgressBase::FinalConstruct();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mProgress = 0;
@@ -1280,5 +1280,5 @@
 #endif
                                       aInitiator, aDescription, aId);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mProgress = 0; /* the first object */
@@ -1294,5 +1294,5 @@
     rc = mProgresses [0]->COMGETTER(OperationDescription) (
         m_bstrOperationDescription.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     for (size_t i = 0; i < mProgresses.size(); i ++)
@@ -1302,5 +1302,5 @@
             BOOL cancelable = FALSE;
             rc = mProgresses [i]->COMGETTER(Cancelable) (&cancelable);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
 
             if (!cancelable)
@@ -1311,5 +1311,5 @@
             ULONG opCount = 0;
             rc = mProgresses [i]->COMGETTER(OperationCount) (&opCount);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
 
             m_cOperations += opCount;
@@ -1318,5 +1318,5 @@
 
     rc =  checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return rc;
@@ -1392,5 +1392,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1402,5 +1402,5 @@
     {
         HRESULT rc = checkProgress();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         /* global percent =
@@ -1418,5 +1418,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1424,5 +1424,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(Completed) (aCompleted);
@@ -1434,5 +1434,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1440,5 +1440,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(Canceled) (aCanceled);
@@ -1450,5 +1450,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1456,5 +1456,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(ResultCode) (aResultCode);
@@ -1466,5 +1466,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1472,5 +1472,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(ErrorInfo) (aErrorInfo);
@@ -1482,5 +1482,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1488,5 +1488,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(Operation) (aOperation);
@@ -1498,5 +1498,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1504,5 +1504,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(OperationDescription) (aOperationDescription);
@@ -1514,5 +1514,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* checkProgress needs a write lock */
@@ -1520,5 +1520,5 @@
 
     HRESULT rc = checkProgress();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     return ProgressBase::COMGETTER(OperationPercent) (aOperationPercent);
@@ -1555,5 +1555,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1563,16 +1563,15 @@
     {
         RTTIMESPEC time;
-        RTTimeNow (&time);
+        RTTimeNow(&time);
 
         HRESULT rc = S_OK;
         bool forever = aTimeout < 0;
         int64_t timeLeft = aTimeout;
-        int64_t lastTime = RTTimeSpecGetMilli (&time);
+        int64_t lastTime = RTTimeSpecGetMilli(&time);
 
         while (!mCompleted && (forever || timeLeft > 0))
         {
             alock.leave();
-            rc = mProgresses.back()->WaitForCompletion (
-                forever ? -1 : (LONG) timeLeft);
+            rc = mProgresses.back()->WaitForCompletion(forever ? -1 : (LONG) timeLeft);
             alock.enter();
 
@@ -1580,15 +1579,15 @@
                 rc = checkProgress();
 
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             if (!forever)
             {
-                RTTimeNow (&time);
-                timeLeft -= RTTimeSpecGetMilli (&time) - lastTime;
-                lastTime = RTTimeSpecGetMilli (&time);
+                RTTimeNow(&time);
+                timeLeft -= RTTimeSpecGetMilli(&time) - lastTime;
+                lastTime = RTTimeSpecGetMilli(&time);
             }
         }
 
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1610,5 +1609,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1662,6 +1661,6 @@
             alock.leave();
             /* wait for the appropriate progress operation completion */
-            rc = mProgresses [progress]-> WaitForOperationCompletion (
-                operation, forever ? -1 : (LONG) timeLeft);
+            rc = mProgresses[progress]-> WaitForOperationCompletion(operation,
+                                                                    forever ? -1 : (LONG) timeLeft);
             alock.enter();
 
@@ -1669,15 +1668,15 @@
                 rc = checkProgress();
 
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             if (!forever)
             {
-                RTTimeNow (&time);
-                timeLeft -= RTTimeSpecGetMilli (&time) - lastTime;
-                lastTime = RTTimeSpecGetMilli (&time);
+                RTTimeNow(&time);
+                timeLeft -= RTTimeSpecGetMilli(&time) - lastTime;
+                lastTime = RTTimeSpecGetMilli(&time);
             }
         }
 
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1690,5 +1689,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
Index: /trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/RemoteUSBDeviceImpl.cpp	(revision 25149)
@@ -137,5 +137,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -150,5 +150,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -163,5 +163,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -176,5 +176,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -189,5 +189,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -202,5 +202,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -215,5 +215,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -228,5 +228,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -241,5 +241,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -254,5 +254,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -267,5 +267,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -280,5 +280,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* RemoteUSBDevice is always remote. */
@@ -297,5 +297,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
Index: /trunk/src/VBox/Main/SerialPortImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SerialPortImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/SerialPortImpl.cpp	(revision 25149)
@@ -205,5 +205,5 @@
     Bstr path(data.strPath);
     HRESULT rc = checkSetPath(path);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
     mData->mPath = path;
 
@@ -348,5 +348,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -362,9 +362,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -389,5 +389,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -401,9 +401,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -463,5 +463,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -477,5 +477,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -497,9 +497,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -531,5 +531,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -551,9 +551,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -585,5 +585,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -616,9 +616,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -631,5 +631,5 @@
     {
         HRESULT rc = checkSetPath (aPath);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         mData.backup();
@@ -650,5 +650,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -662,9 +662,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
Index: /trunk/src/VBox/Main/SessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SessionImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/SessionImpl.cpp	(revision 25149)
@@ -151,5 +151,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -165,5 +165,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -180,5 +180,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -202,5 +202,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -227,5 +227,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* close() needs write lock */
@@ -333,5 +333,5 @@
 
     if (SUCCEEDED(rc))
-    {        
+    {
         mType = SessionType_Direct;
         mState = SessionState_Open;
Index: /trunk/src/VBox/Main/SharedFolderImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SharedFolderImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/SharedFolderImpl.cpp	(revision 25149)
@@ -262,5 +262,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mName is constant during life time, no need to lock */
@@ -275,5 +275,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mHostPath is constant during life time, no need to lock */
@@ -288,5 +288,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mName and mHostPath are constant during life time, no need to lock */
@@ -330,5 +330,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
Index: /trunk/src/VBox/Main/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 25149)
@@ -288,5 +288,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -301,5 +301,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -318,5 +318,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Utf8Str strName(aName);
@@ -341,5 +341,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -354,5 +354,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Utf8Str strDescription(aDescription);
@@ -377,5 +377,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -390,5 +390,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -403,5 +403,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -416,5 +416,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -429,5 +429,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(m->pMachine->snapshotsTreeLockHandle());
@@ -691,8 +691,8 @@
 
     HRESULT rc = m->pMachine->saveHardware(data.hardware);
-    CheckComRCReturnRC (rc);
+    if (FAILED(rc)) return rc;
 
     rc = m->pMachine->saveStorageControllers(data.storage);
-    CheckComRCReturnRC (rc);
+    if (FAILED(rc)) return rc;
 
     alock.unlock();
@@ -708,5 +708,5 @@
             settings::Snapshot snap;
             rc = (*it)->saveSnapshotImpl(snap, aAttrsOnly);
-            CheckComRCReturnRC (rc);
+            if (FAILED(rc)) return rc;
 
             data.llChildSnapshots.push_back(snap);
@@ -814,5 +814,5 @@
         folder.createObject();
         rc = folder->initCopy (this, *it);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
         *it = folder;
     }
@@ -1219,5 +1219,5 @@
          * hard disks are fixed up */
         HRESULT rc = saveSettings();
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1237,5 +1237,5 @@
         /* ensure the directory for the saved state file exists */
         HRESULT rc = VirtualBox::ensureFilePathExists(strStateFilePath);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1671,5 +1671,5 @@
             aTask.modifyBackedUpState(MachineState_PoweredOff);
             rc = saveStateSettings(SaveSTS_StateFilePath);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
@@ -1702,9 +1702,8 @@
                                      1,
                                      false /* aOnline */);
+            if (FAILED(rc)) throw rc;
 
             alock.enter();
             snapshotLock.lock();
-
-            CheckComRCThrowRC(rc);
 
             /* Note: on success, current (old) hard disks will be
@@ -1844,5 +1843,6 @@
         // save all settings, reset the modified flag and commit;
         rc = saveSettings(SaveS_ResetCurStateModified | saveFlags);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
+
         // from here on we cannot roll back on failure any more
 
@@ -1937,5 +1937,5 @@
     ComObjPtr<Snapshot> pSnapshot;
     HRESULT rc = findSnapshot(id, pSnapshot, true /* aSetError */);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     AutoWriteLock snapshotLock(pSnapshot);
@@ -1957,5 +1957,5 @@
         {
             rc = saveSettings();
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
         }
     }
@@ -2152,5 +2152,5 @@
                 // needs to be discarded (merged with the child if any), check prerequisites
                 rc = pHD->prepareDiscard(chain);
-                CheckComRCThrowRC(rc);
+                if (FAILED(rc)) throw rc;
 
                 // for simplicity, we merge pHd onto its child (forward merge), not the
@@ -2256,5 +2256,5 @@
 
             rc = saveAllSnapshots();
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             /// @todo (dmik)
@@ -2300,5 +2300,5 @@
                                  (ULONG)(it->hd->getSize() / _1M),          // weight
                                  it->chain);
-            CheckComRCBreakRC(rc);
+            if (FAILED(rc)) throw rc;
 
             /* prevent from calling cancelDiscard() */
@@ -2309,6 +2309,4 @@
         alock.enter();
         LogFlowThisFunc(("Entered locks OK\n"));
-
-        CheckComRCThrowRC(rc);
     }
     catch (HRESULT aRC) { rc = aRC; }
Index: /trunk/src/VBox/Main/StorageControllerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/StorageControllerImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/StorageControllerImpl.cpp	(revision 25149)
@@ -244,5 +244,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mName is constant during life time, no need to lock */
@@ -257,5 +257,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -271,5 +271,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -283,5 +283,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -337,5 +337,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -360,5 +360,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -383,5 +383,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -407,5 +407,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -474,9 +474,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -499,5 +499,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* The machine doesn't need to be mutable. */
@@ -513,5 +513,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* The machine doesn't need to be mutable. */
@@ -532,5 +532,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -564,9 +564,9 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
     AutoWriteLock alock(this);
 
Index: /trunk/src/VBox/Main/SystemPropertiesImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/SystemPropertiesImpl.cpp	(revision 25149)
@@ -106,8 +106,8 @@
             ComObjPtr<MediumFormat> hdf;
             rc = hdf.createObject();
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             rc = hdf->init (&aVDInfo [i]);
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             mMediumFormats.push_back (hdf);
@@ -182,5 +182,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -197,5 +197,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -221,5 +221,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -235,5 +235,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -249,5 +249,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -263,5 +263,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -277,5 +277,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -291,5 +291,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /** The BIOS supports currently 32 bit LBA numbers (implementing the full
@@ -314,5 +314,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -328,5 +328,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -342,5 +342,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -355,5 +355,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -368,5 +368,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -400,5 +400,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -437,5 +437,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -474,5 +474,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -501,5 +501,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* no need to lock, this is const */
@@ -541,5 +541,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -553,5 +553,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -570,5 +570,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -582,5 +582,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -601,5 +601,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -616,5 +616,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -628,5 +628,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -645,5 +645,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -657,5 +657,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -674,5 +674,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -686,5 +686,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -704,5 +704,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -716,5 +716,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* VirtualBox::saveSettings() needs a write lock */
@@ -734,5 +734,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -749,5 +749,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -756,17 +756,17 @@
 
     rc = setDefaultMachineFolder(data.strDefaultMachineFolder);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = setDefaultHardDiskFolder(data.strDefaultHardDiskFolder);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = setDefaultHardDiskFormat(data.strDefaultHardDiskFormat);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = setRemoteDisplayAuthLibrary(data.strRemoteDisplayAuthLibrary);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = setWebServiceAuthLibrary(data.strWebServiceAuthLibrary);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     mLogHistoryCount = data.ulLogHistoryCount;
@@ -778,5 +778,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
Index: /trunk/src/VBox/Main/USBControllerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/USBControllerImpl.cpp	(revision 25149)
@@ -217,5 +217,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -232,9 +232,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -259,5 +259,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -273,9 +273,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -300,5 +300,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* not accessing data -- no need to lock */
@@ -364,5 +364,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -393,9 +393,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -424,9 +424,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -487,9 +487,9 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* the machine needs to be mutable */
-    Machine::AutoMutableStateDependency adep (mParent);
-    CheckComRCReturnRC(adep.rc());
+    Machine::AutoMutableStateDependency adep(mParent);
+    if (FAILED(adep.rc())) return adep.rc();
 
     AutoWriteLock alock(this);
@@ -588,5 +588,5 @@
         HRESULT rc = pFilter->init(this,        // parent
                                    f);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         mDeviceFilters->push_back(pFilter);
@@ -608,5 +608,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
Index: /trunk/src/VBox/Main/USBDeviceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/USBDeviceImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/USBDeviceImpl.cpp	(revision 25149)
@@ -150,5 +150,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -170,5 +170,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -190,5 +190,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -210,5 +210,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -229,5 +229,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -249,5 +249,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -269,5 +269,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -289,5 +289,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -302,5 +302,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -315,5 +315,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -328,5 +328,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
@@ -341,5 +341,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* this is const, no need to lock */
Index: /trunk/src/VBox/Main/VFSExplorerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VFSExplorerImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/VFSExplorerImpl.cpp	(revision 25149)
@@ -128,5 +128,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -144,5 +144,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -274,5 +274,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -342,5 +342,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -389,5 +389,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -465,5 +465,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock appLock(this);
@@ -518,5 +518,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock(this);
@@ -580,5 +580,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -610,5 +610,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -647,5 +647,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock(this);
Index: /trunk/src/VBox/Main/VirtualBoxBase.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxBase.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/VirtualBoxBase.cpp	(revision 25149)
@@ -803,5 +803,5 @@
         ComObjPtr<VirtualBoxErrorInfo> info;
         rc = info.createObject();
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
 
 #if !defined (VBOX_WITH_XPCOM)
@@ -813,5 +813,5 @@
             ComPtr<IErrorInfo> err;
             rc = ::GetErrorInfo (0, err.asOutParam());
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
             rc = err.queryInterfaceTo(curInfo.asOutParam());
             if (FAILED (rc))
@@ -834,5 +834,5 @@
         /* set the current error info and preserve the previous one if any */
         rc = info->init (aResultCode, aIID, aComponent, aText, curInfo);
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
 
         ComPtr<IErrorInfo> err;
@@ -849,5 +849,5 @@
             nsCOMPtr <nsIExceptionManager> em;
             rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             ComPtr<IVirtualBoxErrorInfo> curInfo;
@@ -857,7 +857,7 @@
                 ComPtr<nsIException> ex;
                 rc = em->GetCurrentException (ex.asOutParam());
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
                 rc = ex.queryInterfaceTo(curInfo.asOutParam());
-                if (FAILED (rc))
+                if (FAILED(rc))
                 {
                     /* create a IVirtualBoxErrorInfo wrapper for the native
@@ -878,5 +878,5 @@
             /* set the current error info and preserve the previous one if any */
             rc = info->init (aResultCode, aIID, aComponent, aText, curInfo);
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             ComPtr<nsIException> ex;
Index: /trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/VirtualBoxErrorInfoImpl.cpp	(revision 25149)
@@ -228,5 +228,5 @@
     ComPtr<IVirtualBoxErrorInfo> info;
     nsresult rv = COMGETTER(Next) (info.asOutParam());
-    CheckComRCReturnRC(rv);
+    if (FAILED(rv)) return rv;
     return info.queryInterfaceTo(aInner);
 }
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 25149)
@@ -347,5 +347,5 @@
 
         rc = m->pHost->loadSettings(m->pMainConfigFile->host);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* create the system properties object, someone may need it too */
@@ -355,5 +355,5 @@
 
         rc = m->pSystemProperties->loadSettings(m->pMainConfigFile->systemProperties);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         /* guest OS type objects, needed by machines */
@@ -405,8 +405,8 @@
             if (SUCCEEDED(rc = pDhcpServer.createObject()))
                 rc = pDhcpServer->init(this, data);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
 
             rc = registerDHCPServer(pDhcpServer, false /* aSaveRegistry */);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
     }
@@ -519,8 +519,8 @@
                                  DeviceType_HardDisk,
                                  xmlHD);         // XML data; this recurses to processes the children
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         rc = registerHardDisk(pHardDisk, false /* aSaveRegistry */);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -534,8 +534,8 @@
         if (SUCCEEDED(pImage.createObject()))
             rc = pImage->init(this, NULL, DeviceType_DVD, xmlDvd);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         rc = registerDVDImage(pImage, false /* aSaveRegistry */);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -549,8 +549,8 @@
         if (SUCCEEDED(pImage.createObject()))
             rc = pImage->init(this, NULL, DeviceType_Floppy, xmlFloppy);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         rc = registerFloppyImage(pImage, false /* aSaveRegistry */);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -705,5 +705,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     sVersion.cloneTo(aVersion);
@@ -716,5 +716,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     *aRevision = sRevision;
@@ -727,5 +727,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     sPackageType.cloneTo(aPackageType);
@@ -738,5 +738,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mHomeDir is const and doesn't need a lock */
@@ -750,5 +750,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mCfgFile.mName is const and doesn't need a lock */
@@ -762,5 +762,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mHost is const, no need to lock */
@@ -775,5 +775,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mSystemProperties is const, no need to lock */
@@ -789,5 +789,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -805,5 +805,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -822,5 +822,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -839,5 +839,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -854,5 +854,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* protect mProgressOperations */
@@ -870,5 +870,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -890,5 +890,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     return setError (E_NOTIMPL, "Not yet implemented");
@@ -902,5 +902,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* mPerformanceCollector is const, no need to lock */
@@ -920,5 +920,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this);
@@ -940,5 +940,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     const char * url = NULL;
@@ -1038,5 +1038,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* Compose the settings file name using the following scheme:
@@ -1064,5 +1064,5 @@
     ComObjPtr<Machine> machine;
     rc = machine.createObject();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* Create UUID if an empty one was specified. */
@@ -1073,5 +1073,5 @@
     GuestOSType *osType;
     rc = findGuestOSType(aOsTypeId, osType);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* initialize the machine object */
@@ -1107,5 +1107,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = E_FAIL;
@@ -1119,5 +1119,5 @@
     ComObjPtr<Machine> machine;
     rc = machine.createObject();
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* Create UUID if an empty one was specified. */
@@ -1128,5 +1128,5 @@
     GuestOSType *osType;
     rc = findGuestOSType(aOsTypeId, osType);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* initialize the machine object */
@@ -1155,5 +1155,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = E_FAIL;
@@ -1185,5 +1185,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc;
@@ -1191,5 +1191,5 @@
     Bstr name;
     rc = aMachine->COMGETTER(Name) (name.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* We need the children map lock here to keep the getDependentChild() result
@@ -1227,5 +1227,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<Machine> machine;
@@ -1248,5 +1248,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* start with not found */
@@ -1299,5 +1299,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -1306,8 +1306,8 @@
 
     HRESULT rc = findMachine (id, true /* setError */, &machine);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = machine->trySetRegistered (FALSE);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* remove from the collection of registered machines */
@@ -1333,5 +1333,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* we don't access non-const data members so no need to lock */
@@ -1365,5 +1365,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* we don't access non-const data members so no need to lock */
@@ -1412,5 +1412,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aId);
@@ -1431,5 +1431,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<Medium> hardDisk;
@@ -1450,5 +1450,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = VBOX_E_FILE_ERROR;
@@ -1479,5 +1479,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aId);
@@ -1498,5 +1498,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<Medium> image;
@@ -1517,5 +1517,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = VBOX_E_FILE_ERROR;
@@ -1548,5 +1548,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aId);
@@ -1568,5 +1568,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<Medium> image;
@@ -1604,5 +1604,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* first, look for a substitution */
@@ -1647,5 +1647,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     return setError (E_NOTIMPL, "Not yet implemented");
@@ -1657,5 +1657,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     return setError (E_NOTIMPL, "Not yet implemented");
@@ -1672,6 +1672,6 @@
         return E_POINTER;
 
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock (this);
@@ -1701,5 +1701,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* start with nothing found */
@@ -1726,5 +1726,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Utf8Str strKey(aKey);
@@ -1786,5 +1786,5 @@
         /* save settings on success */
         HRESULT rc = saveSettings();
-        CheckComRCReturnRC (rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -1804,5 +1804,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aMachineId);
@@ -1810,10 +1810,10 @@
 
     HRESULT rc = findMachine (id, true /* setError */, &machine);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* check the session state */
     SessionState_T state;
     rc = aSession->COMGETTER(State) (&state);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (state != SessionState_Closed)
@@ -1860,5 +1860,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aMachineId);
@@ -1866,10 +1866,10 @@
 
     HRESULT rc = findMachine (id, true /* setError */, &machine);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* check the session state */
     SessionState_T state;
     rc = aSession->COMGETTER(State) (&state);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (state != SessionState_Closed)
@@ -1914,5 +1914,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Guid id(aMachineId);
@@ -1920,10 +1920,10 @@
 
     HRESULT rc = findMachine (id, true /* setError */, &machine);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     /* check the session state */
     SessionState_T state;
     rc = aSession->COMGETTER(State) (&state);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (state != SessionState_Closed)
@@ -1951,5 +1951,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
 #if 0 /** @todo r=bird,r=pritesh: must check that the interface id match correct or we might screw up with old code! */
@@ -1975,5 +1975,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = S_OK;
@@ -2076,5 +2076,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     Bstr id;
@@ -2100,5 +2100,5 @@
 {
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComPtr<IProgress> progress;
@@ -2181,5 +2181,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     /* create the SVCHelperClientThread() argument */
@@ -2826,5 +2826,5 @@
 
             HRESULT rc = hd->compareLocationTo(location.c_str(), result);
-            CheckComRCReturnRC(rc);
+            if (FAILED(rc)) return rc;
 
             if (result == 0)
@@ -3235,5 +3235,5 @@
 HRESULT VirtualBox::saveSettings()
 {
-    AutoCaller autoCaller (this);
+    AutoCaller autoCaller(this);
     AssertComRCReturn(autoCaller.rc(), autoCaller.rc());
 
@@ -3267,5 +3267,5 @@
             rc = (*it)->saveSettings(med);
             m->pMainConfigFile->llHardDisks.push_back(med);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
         }
 
@@ -3278,5 +3278,5 @@
             settings::Medium med;
             rc = (*it)->saveSettings(med);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
             m->pMainConfigFile->llDvdImages.push_back(med);
         }
@@ -3290,5 +3290,5 @@
             settings::Medium med;
             rc = (*it)->saveSettings(med);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
             m->pMainConfigFile->llFloppyImages.push_back(med);
         }
@@ -3302,5 +3302,5 @@
             settings::DHCPServer d;
             rc = (*it)->saveSettings(d);
-            CheckComRCThrowRC(rc);
+            if (FAILED(rc)) throw rc;
             m->pMainConfigFile->llDhcpServers.push_back(d);
         }
@@ -3308,8 +3308,8 @@
         /* host data (USB filters) */
         rc = m->pHost->saveSettings(m->pMainConfigFile->host);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         rc = m->pSystemProperties->saveSettings(m->pMainConfigFile->systemProperties);
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         // now write out the XML
@@ -3349,5 +3349,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -3378,5 +3378,5 @@
         /* Machine::trySetRegistered() will commit and save machine settings */
         rc = aMachine->trySetRegistered(TRUE);
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
     }
 
@@ -3424,5 +3424,5 @@
                                          aHardDisk->getLocationFull(),
                                          strConflict);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (strConflict.length())
@@ -3541,5 +3541,5 @@
                                          aImage->getLocationFull(),
                                          strConflict);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (strConflict.length())
@@ -3644,5 +3644,5 @@
                                          aImage->getLocationFull(),
                                          strConflict);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     if (strConflict.length())
@@ -4478,13 +4478,13 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     ComObjPtr<DHCPServer> dhcpServer;
     dhcpServer.createObject();
     HRESULT rc = dhcpServer->init (this, aName);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     rc = registerDHCPServer(dhcpServer, true);
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     dhcpServer.queryInterfaceTo(aServer);
@@ -4504,5 +4504,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoWriteLock alock(this);
@@ -4518,5 +4518,5 @@
     {
         rc = (*it)->COMGETTER(NetworkName) (bstr.asOutParam());
-        CheckComRCThrowRC(rc);
+        if (FAILED(rc)) throw rc;
 
         if(bstr == aName)
@@ -4538,5 +4538,5 @@
 
     AutoCaller autoCaller(this);
-    CheckComRCReturnRC(autoCaller.rc());
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     HRESULT rc = unregisterDHCPServer(static_cast<DHCPServer *>(aServer), true);
@@ -4578,5 +4578,5 @@
     HRESULT rc;
     rc = aDHCPServer->COMGETTER(NetworkName) (name.asOutParam());
-    CheckComRCReturnRC(rc);
+    if (FAILED(rc)) return rc;
 
     ComPtr<IDHCPServer> existing;
Index: /trunk/src/VBox/Main/generic/NetIf-generic.cpp
===================================================================
--- /trunk/src/VBox/Main/generic/NetIf-generic.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/generic/NetIf-generic.cpp	(revision 25149)
@@ -242,5 +242,4 @@
         if(SUCCEEDED(rc))
         {
-            CheckComRCReturnRC(rc);
             progress.queryInterfaceTo(aProgress);
             rc = NetIfAdpCtl(Utf8Str(ifname).c_str(), "remove", NULL, NULL);
Index: /trunk/src/VBox/Main/glue/SupportErrorInfo.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/SupportErrorInfo.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/glue/SupportErrorInfo.cpp	(revision 25149)
@@ -144,5 +144,5 @@
             ComPtr<IErrorInfo> err;
             rc = ::GetErrorInfo (0, err.asOutParam());
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
             rc = err.queryInterfaceTo(curInfo.asOutParam());
             if (FAILED (rc))
@@ -161,5 +161,5 @@
         }
         /* On failure, curInfo will stay null */
-        Assert (SUCCEEDED(rc) || curInfo.isNull());
+        Assert(SUCCEEDED(rc) || curInfo.isNull());
 
         /* set the current error info and preserve the previous one if any */
@@ -174,8 +174,8 @@
                 ComObjPtr<VirtualBoxErrorInfoGlue> infoObj;
                 rc = infoObj.createObject();
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
 
                 rc = infoObj->init (aInfo, curInfo);
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
 
                 info = infoObj;
@@ -184,5 +184,5 @@
             /* we want to return the head's result code */
             rc = info->COMGETTER(ResultCode) (&aResultCode);
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
         }
         else
@@ -190,8 +190,8 @@
             ComObjPtr<VirtualBoxErrorInfo> infoObj;
             rc = infoObj.createObject();
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             rc = infoObj->init (aResultCode, aIID, aComponent, strText.c_str(), curInfo);
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             info = infoObj;
@@ -211,5 +211,5 @@
             nsCOMPtr <nsIExceptionManager> em;
             rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
-            CheckComRCBreakRC (rc);
+            if (FAILED(rc)) break;
 
             ComPtr<IVirtualBoxErrorInfo> curInfo;
@@ -219,5 +219,5 @@
                 ComPtr<nsIException> ex;
                 rc = em->GetCurrentException (ex.asOutParam());
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
                 rc = ex.queryInterfaceTo(curInfo.asOutParam());
                 if (FAILED (rc))
@@ -249,8 +249,8 @@
                     ComObjPtr<VirtualBoxErrorInfoGlue> infoObj;
                     rc = infoObj.createObject();
-                    CheckComRCBreakRC (rc);
+                    if (FAILED(rc)) break;
 
                     rc = infoObj->init (aInfo, curInfo);
-                    CheckComRCBreakRC (rc);
+                    if (FAILED(rc)) break;
 
                     info = infoObj;
@@ -260,5 +260,5 @@
                 PRInt32 lrc;
                 rc = info->COMGETTER(ResultCode) (&lrc); aResultCode = lrc;
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
             }
             else
@@ -266,8 +266,8 @@
                 ComObjPtr<VirtualBoxErrorInfo> infoObj;
                 rc = infoObj.createObject();
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
 
                 rc = infoObj->init(aResultCode, aIID, aComponent, strText, curInfo);
-                CheckComRCBreakRC (rc);
+                if (FAILED(rc)) break;
 
                 info = infoObj;
Index: /trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp	(revision 25148)
+++ /trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp	(revision 25149)
@@ -254,5 +254,5 @@
     ComPtr<IVirtualBoxErrorInfo> info;
     nsresult rv = COMGETTER(Next) (info.asOutParam());
-    CheckComRCReturnRC(rv);
+    if (FAILED(rv)) return rv;
     return info.queryInterfaceTo(aInner);
 }
@@ -305,5 +305,5 @@
         ComPtr<IVirtualBoxErrorInfo> next;
         rc = cur->COMGETTER(Next) (next.asOutParam());
-        CheckComRCReturnRC(rc);
+        if (FAILED(rc)) return rc;
 
         if (next.isNull())
@@ -327,5 +327,5 @@
         ComObjPtr<VirtualBoxErrorInfoGlue> wrapper;
         rc = wrapper.createObject();
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
 
         -- prev;
@@ -338,5 +338,5 @@
         *prev = wrapper;
 
-        CheckComRCBreakRC (rc);
+        if (FAILED(rc)) break;
     }
 
Index: /trunk/src/VBox/Main/include/MachineImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/MachineImpl.h	(revision 25148)
+++ /trunk/src/VBox/Main/include/MachineImpl.h	(revision 25149)
@@ -350,5 +350,5 @@
      *  @code
      *      AutoCaller autoCaller(this);
-     *      CheckComRCReturnRC(autoCaller.rc());
+     *      if (FAILED(autoCaller.rc())) return autoCaller.rc();
      *
      *      Machine::AutoStateDependency<MutableStateDep> adep(mParent);
