Index: trunk/src/VBox/Main/ApplianceImpl.cpp
===================================================================
--- trunk/src/VBox/Main/ApplianceImpl.cpp	(revision 25146)
+++ 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 */
