Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 33838)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp	(revision 33839)
@@ -69,7 +69,10 @@
 }
 
-
 /**
- * Print out progress on the console
+ * Print out progress on the console.
+ *
+ * This runs the main event queue every now and then to prevent piling up
+ * unhandled things (which doesn't cause real problems, just makes things
+ * react a little slower than in the ideal case).
  */
 HRESULT showProgress(ComPtr<IProgress> progress)
@@ -77,9 +80,8 @@
     using namespace com;
 
-    BOOL fCompleted;
-    ULONG ulCurrentPercent;
+    BOOL fCompleted = FALSE;
+    ULONG ulCurrentPercent = 0;
     ULONG ulLastPercent = 0;
 
-    ULONG ulCurrentOperationPercent;
     ULONG ulLastOperationPercent = (ULONG)-1;
 
@@ -87,6 +89,14 @@
     Bstr bstrOperationDescription;
 
-    ULONG cOperations;
-    progress->COMGETTER(OperationCount)(&cOperations);
+    EventQueue::getMainEventQueue()->processEventQueue(0);
+
+    ULONG cOperations = 1;
+    HRESULT hrc = progress->COMGETTER(OperationCount)(&cOperations);
+    if (FAILED(hrc))
+    {
+        RTStrmPrintf(g_pStdErr, "Progress object failure: %Rhrc\n", hrc);
+        RTStrmFlush(g_pStdErr);
+        return hrc;
+    }
 
     if (!g_fDetailedProgress)
@@ -99,5 +109,5 @@
     bool fCanceledAlready = false;
     BOOL fCancelable;
-    HRESULT hrc = progress->COMGETTER(Cancelable)(&fCancelable);
+    hrc = progress->COMGETTER(Cancelable)(&fCancelable);
     if (FAILED(hrc))
         fCancelable = FALSE;
@@ -110,17 +120,25 @@
     }
 
-    while (SUCCEEDED(progress->COMGETTER(Completed(&fCompleted))))
-    {
-        ULONG ulOperation;
-        progress->COMGETTER(Operation)(&ulOperation);
-
+    hrc = progress->COMGETTER(Completed(&fCompleted));
+    while (SUCCEEDED(hrc))
+    {
         progress->COMGETTER(Percent(&ulCurrentPercent));
-        progress->COMGETTER(OperationPercent(&ulCurrentOperationPercent));
 
         if (g_fDetailedProgress)
         {
+            ULONG ulOperation = 1;
+            hrc = progress->COMGETTER(Operation)(&ulOperation);
+            if (FAILED(hrc))
+                break;
+            ULONG ulCurrentOperationPercent = 0;
+            hrc = progress->COMGETTER(OperationPercent(&ulCurrentOperationPercent));
+            if (FAILED(hrc))
+                break;
+
             if (ulLastOperation != ulOperation)
             {
-                progress->COMGETTER(OperationDescription(bstrOperationDescription.asOutParam()));
+                hrc = progress->COMGETTER(OperationDescription(bstrOperationDescription.asOutParam()));
+                if (FAILED(hrc))
+                    break;
                 ulLastPercent = (ULONG)-1;        // force print
                 ulLastOperation = ulOperation;
@@ -131,5 +149,5 @@
                )
             {
-                LONG lSecsRem;
+                LONG lSecsRem = 0;
                 progress->COMGETTER(TimeRemaining)(&lSecsRem);
 
@@ -171,4 +189,7 @@
         /* make sure the loop is not too tight */
         progress->WaitForCompletion(100);
+
+        EventQueue::getMainEventQueue()->processEventQueue(0);
+        hrc = progress->COMGETTER(Completed(&fCompleted));
     }
 
@@ -184,5 +205,6 @@
     /* complete the line. */
     LONG iRc = E_FAIL;
-    if (SUCCEEDED(progress->COMGETTER(ResultCode)(&iRc)))
+    hrc = progress->COMGETTER(ResultCode)(&iRc);
+    if (SUCCEEDED(hrc))
     {
         if (SUCCEEDED(iRc))
@@ -191,10 +213,19 @@
             RTStrmPrintf(g_pStdErr, "CANCELED\n");
         else
-            RTStrmPrintf(g_pStdErr, "FAILED\n");
+        {
+            if (!g_fDetailedProgress)
+                RTStrmPrintf(g_pStdErr, "\n");
+            RTStrmPrintf(g_pStdErr, "Progress state: %Rhrc\n", iRc);
+        }
+        hrc = iRc;
     }
     else
-        RTStrmPrintf(g_pStdErr, "\n");
+    {
+        if (!g_fDetailedProgress)
+            RTStrmPrintf(g_pStdErr, "\n");
+        RTStrmPrintf(g_pStdErr, "Progress object failure: %Rhrc\n", hrc);
+    }
     RTStrmFlush(g_pStdErr);
-    return iRc;
+    return hrc;
 }
 
