Index: trunk/src/VBox/Main/glue/ErrorInfo.cpp
===================================================================
--- trunk/src/VBox/Main/glue/ErrorInfo.cpp	(revision 32404)
+++ trunk/src/VBox/Main/glue/ErrorInfo.cpp	(revision 32718)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,9 +18,8 @@
  */
 
-#if !defined (VBOX_WITH_XPCOM)
-#else
- #include <nsIServiceManager.h>
- #include <nsIExceptionService.h>
- #include <nsCOMPtr.h>
+#if defined(VBOX_WITH_XPCOM)
+# include <nsIServiceManager.h>
+# include <nsIExceptionService.h>
+# include <nsCOMPtr.h>
 #endif
 
@@ -92,8 +91,8 @@
     HRESULT rc = E_FAIL;
 
-#if !defined (VBOX_WITH_XPCOM)
+#if !defined(VBOX_WITH_XPCOM)
 
     ComPtr<IErrorInfo> err;
-    rc = ::GetErrorInfo (0, err.asOutParam());
+    rc = ::GetErrorInfo(0, err.asOutParam());
     if (rc == S_OK && err)
     {
@@ -104,5 +103,5 @@
         rc = err.queryInterfaceTo(info.asOutParam());
         if (SUCCEEDED(rc) && info)
-            init (info);
+            init(info);
 
         if (!mIsFullAvailable)
@@ -110,13 +109,13 @@
             bool gotSomething = false;
 
-            rc = err->GetGUID (mInterfaceID.asOutParam());
+            rc = err->GetGUID(mInterfaceID.asOutParam());
             gotSomething |= SUCCEEDED(rc);
             if (SUCCEEDED(rc))
-                GetInterfaceNameByIID (mInterfaceID, mInterfaceName.asOutParam());
-
-            rc = err->GetSource (mComponent.asOutParam());
+                GetInterfaceNameByIID(mInterfaceID, mInterfaceName.asOutParam());
+
+            rc = err->GetSource(mComponent.asOutParam());
             gotSomething |= SUCCEEDED(rc);
 
-            rc = err->GetDescription (mText.asOutParam());
+            rc = err->GetDescription(mText.asOutParam());
             gotSomething |= SUCCEEDED(rc);
 
@@ -124,9 +123,9 @@
                 mIsBasicAvailable = true;
 
-            AssertMsg (gotSomething, ("Nothing to fetch!\n"));
+            AssertMsg(gotSomething, ("Nothing to fetch!\n"));
         }
     }
 
-#else // defined (VBOX_WITH_XPCOM)
+#else // defined(VBOX_WITH_XPCOM)
 
     nsCOMPtr<nsIExceptionService> es;
@@ -135,5 +134,5 @@
     {
         nsCOMPtr<nsIExceptionManager> em;
-        rc = es->GetCurrentExceptionManager(getter_AddRefs (em));
+        rc = es->GetCurrentExceptionManager(getter_AddRefs(em));
         if (NS_SUCCEEDED(rc))
         {
@@ -148,5 +147,5 @@
                 rc = ex.queryInterfaceTo(info.asOutParam());
                 if (NS_SUCCEEDED(rc) && info)
-                    init (info);
+                    init(info);
 
                 if (!mIsFullAvailable)
@@ -163,5 +162,5 @@
                     {
                         mText = Bstr(pszMsg);
-                        nsMemory::Free(mText);
+                        nsMemory::Free(pszMsg);
                     }
 
@@ -169,9 +168,9 @@
                         mIsBasicAvailable = true;
 
-                    AssertMsg (gotSomething, ("Nothing to fetch!\n"));
+                    AssertMsg(gotSomething, ("Nothing to fetch!\n"));
                 }
 
                 // set the exception to NULL (to emulate Win32 behavior)
-                em->SetCurrentException (NULL);
+                em->SetCurrentException(NULL);
 
                 rc = NS_OK;
@@ -183,7 +182,7 @@
         rc = NS_OK;
 
-    AssertComRC (rc);
-
-#endif // defined (VBOX_WITH_XPCOM)
+    AssertComRC(rc);
+
+#endif // defined(VBOX_WITH_XPCOM)
 }
 
@@ -196,5 +195,5 @@
         return;
 
-#if !defined (VBOX_WITH_XPCOM)
+#if !defined(VBOX_WITH_XPCOM)
 
     ComPtr<IUnknown> iface = aI;
@@ -203,12 +202,12 @@
     if (SUCCEEDED(rc))
     {
-        rc = serr->InterfaceSupportsErrorInfo (aIID);
+        rc = serr->InterfaceSupportsErrorInfo(aIID);
         if (SUCCEEDED(rc))
-            init (aKeepObj);
+            init(aKeepObj);
     }
 
 #else
 
-    init (aKeepObj);
+    init(aKeepObj);
 
 #endif
@@ -217,5 +216,5 @@
     {
         mCalleeIID = aIID;
-        GetInterfaceNameByIID (aIID, mCalleeName.asOutParam());
+        GetInterfaceNameByIID(aIID, mCalleeName.asOutParam());
     }
 }
@@ -223,5 +222,5 @@
 void ErrorInfo::init(IVirtualBoxErrorInfo *info)
 {
-    AssertReturnVoid (info);
+    AssertReturnVoid(info);
 
     HRESULT rc = E_FAIL;
@@ -230,10 +229,10 @@
     LONG lrc;
 
-    rc = info->COMGETTER(ResultCode) (&lrc); mResultCode = lrc;
+    rc = info->COMGETTER(ResultCode)(&lrc); mResultCode = lrc;
     gotSomething |= SUCCEEDED(rc);
     gotAll &= SUCCEEDED(rc);
 
     Bstr iid;
-    rc = info->COMGETTER(InterfaceID) (iid.asOutParam());
+    rc = info->COMGETTER(InterfaceID)(iid.asOutParam());
     gotSomething |= SUCCEEDED(rc);
     gotAll &= SUCCEEDED(rc);
@@ -241,12 +240,12 @@
     {
         mInterfaceID = iid;
-        GetInterfaceNameByIID (mInterfaceID, mInterfaceName.asOutParam());
-    }
-
-    rc = info->COMGETTER(Component) (mComponent.asOutParam());
-    gotSomething |= SUCCEEDED(rc);
-    gotAll &= SUCCEEDED(rc);
-
-    rc = info->COMGETTER(Text) (mText.asOutParam());
+        GetInterfaceNameByIID(mInterfaceID, mInterfaceName.asOutParam());
+    }
+
+    rc = info->COMGETTER(Component)(mComponent.asOutParam());
+    gotSomething |= SUCCEEDED(rc);
+    gotAll &= SUCCEEDED(rc);
+
+    rc = info->COMGETTER(Text)(mText.asOutParam());
     gotSomething |= SUCCEEDED(rc);
     gotAll &= SUCCEEDED(rc);
@@ -255,5 +254,5 @@
 
     ComPtr<IVirtualBoxErrorInfo> next;
-    rc = info->COMGETTER(Next) (next.asOutParam());
+    rc = info->COMGETTER(Next)(next.asOutParam());
     if (SUCCEEDED(rc) && !next.isNull())
     {
@@ -270,5 +269,5 @@
     mIsFullAvailable = gotAll;
 
-    AssertMsg (gotSomething, ("Nothing to fetch!\n"));
+    AssertMsg(gotSomething, ("Nothing to fetch!\n"));
 }
 
@@ -279,6 +278,6 @@
 ////////////////////////////////////////////////////////////////////////////////
 
-ProgressErrorInfo::ProgressErrorInfo (IProgress *progress) :
-    ErrorInfo (false /* aDummy */)
+ProgressErrorInfo::ProgressErrorInfo(IProgress *progress) :
+    ErrorInfo(false /* aDummy */)
 {
     Assert(progress);
@@ -287,7 +286,7 @@
 
     ComPtr<IVirtualBoxErrorInfo> info;
-    HRESULT rc = progress->COMGETTER(ErrorInfo) (info.asOutParam());
+    HRESULT rc = progress->COMGETTER(ErrorInfo)(info.asOutParam());
     if (SUCCEEDED(rc) && info)
-        init (info);
+        init(info);
 }
 
@@ -305,5 +304,5 @@
     HRESULT rc = S_OK;
 
-#if !defined (VBOX_WITH_XPCOM)
+#if !defined(VBOX_WITH_XPCOM)
 
     ComPtr<IErrorInfo> err;
@@ -311,16 +310,16 @@
     {
         rc = mErrorInfo.queryInterfaceTo(err.asOutParam());
-        AssertComRC (rc);
-    }
-    rc = ::SetErrorInfo (0, err);
-
-#else // !defined (VBOX_WITH_XPCOM)
+        AssertComRC(rc);
+    }
+    rc = ::SetErrorInfo(0, err);
+
+#else // !defined(VBOX_WITH_XPCOM)
 
     nsCOMPtr <nsIExceptionService> es;
-    es = do_GetService (NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
+    es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc);
     if (NS_SUCCEEDED(rc))
     {
         nsCOMPtr <nsIExceptionManager> em;
-        rc = es->GetCurrentExceptionManager (getter_AddRefs (em));
+        rc = es->GetCurrentExceptionManager(getter_AddRefs(em));
         if (NS_SUCCEEDED(rc))
         {
@@ -329,11 +328,11 @@
             {
                 rc = mErrorInfo.queryInterfaceTo(ex.asOutParam());
-                AssertComRC (rc);
+                AssertComRC(rc);
             }
-            rc = em->SetCurrentException (ex);
+            rc = em->SetCurrentException(ex);
         }
     }
 
-#endif // !defined (VBOX_WITH_XPCOM)
+#endif // !defined(VBOX_WITH_XPCOM)
 
     if (SUCCEEDED(rc))
Index: trunk/src/VBox/Main/glue/errorprint.cpp
===================================================================
--- trunk/src/VBox/Main/glue/errorprint.cpp	(revision 32404)
+++ trunk/src/VBox/Main/glue/errorprint.cpp	(revision 32718)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2009 Oracle Corporation
+ * Copyright (C) 2009-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,4 +24,5 @@
 
 #include <iprt/stream.h>
+#include <iprt/message.h>
 #include <iprt/path.h>
 
@@ -31,5 +32,5 @@
 void GluePrintErrorInfo(com::ErrorInfo &info)
 {
-    Utf8Str str = Utf8StrFmt("ERROR: %ls\n"
+    Utf8Str str = Utf8StrFmt("%ls\n"
                              "Details: code %Rhrc (0x%RX32), component %ls, interface %ls, callee %ls\n"
                              ,
@@ -41,6 +42,6 @@
                              info.getCalleeName().raw());
     // print and log
-    RTPrintf("%s", str.c_str());
-    Log(("%s", str.c_str()));
+    RTMsgError("%s", str.c_str());
+    Log(("ERROR: %s", str.c_str()));
 }
 
@@ -55,5 +56,5 @@
                                 strFilename.c_str());
     // print and log
-    RTPrintf("%s", str.c_str());
+    RTStrmPrintf(g_pStdErr, "%s", str.c_str());
     Log(("%s", str.c_str()));
 }
@@ -61,8 +62,8 @@
 void GluePrintRCMessage(HRESULT rc)
 {
-    Utf8Str str = Utf8StrFmt("ERROR: code %Rhra (extended info not available)\n", rc);
+    Utf8Str str = Utf8StrFmt("Code %Rhra (extended info not available)\n", rc);
     // print and log
-    RTPrintf("%s", str.c_str());
-    Log(("%s", str.c_str()));
+    RTMsgError("%s", str.c_str());
+    Log(("ERROR: %s", str.c_str()));
 }
 
