Index: /trunk/include/iprt/ministring_cpp.h
===================================================================
--- /trunk/include/iprt/ministring_cpp.h	(revision 21392)
+++ /trunk/include/iprt/ministring_cpp.h	(revision 21393)
@@ -35,4 +35,6 @@
 #include <iprt/string.h>
 
+#include <new>
+
 /**
  *  "ministring" is a small C++ string class that does not depend on anything
@@ -69,4 +71,7 @@
      */
     ministring(const ministring &s)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         copyFrom(s);
@@ -79,4 +84,7 @@
      */
     ministring(const char *pcsz)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         copyFrom(pcsz);
@@ -119,4 +127,7 @@
      */
     void reserve(size_t cb)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         if (    (cb != m_cbAllocated)
@@ -125,4 +136,8 @@
         {
             m_psz = (char*)RTMemRealloc(m_psz, cb);
+#ifdef RT_EXCEPTIONS_ENABLED
+            if (!m_psz)
+                throw std::bad_alloc();
+#endif
             m_cbAllocated = cb;
         }
@@ -177,4 +192,7 @@
      */
     ministring& operator=(const char *pcsz)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         if (m_psz != pcsz)
@@ -192,4 +210,7 @@
      */
     ministring& operator=(const ministring &s)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         if (this != &s)
@@ -245,23 +266,4 @@
     {
         return c_str();
-    }
-
-    /**
-     * Returns true if the member string has no length. This states nothing about
-     * how much memory might be allocated.
-     * @return
-     */
-    bool isEmpty() const
-    {
-        return length() == 0;
-    }
-
-    /**
-     * Returns true if no memory is currently allocated.
-     * @return
-     */
-    bool isNull() const
-    {
-        return m_psz == NULL;
     }
 
@@ -344,4 +346,7 @@
      */
     void copyFrom(const ministring &s)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         if ((m_cbLength = s.m_cbLength))
@@ -349,4 +354,8 @@
             m_cbAllocated = m_cbLength + 1;
             m_psz = (char*)RTMemAlloc(m_cbAllocated);
+#ifdef RT_EXCEPTIONS_ENABLED
+            if (!m_psz)
+                throw std::bad_alloc();
+#endif
             memcpy(m_psz, s.m_psz, m_cbAllocated);      // include 0 terminator
         }
@@ -368,4 +377,7 @@
      */
     void copyFrom(const char *pcsz)
+#ifdef RT_EXCEPTIONS_ENABLED
+        throw(std::bad_alloc)
+#endif
     {
         if (pcsz)
@@ -374,4 +386,8 @@
             m_cbAllocated = m_cbLength + 1;
             m_psz = (char*)RTMemAlloc(m_cbAllocated);
+#ifdef RT_EXCEPTIONS_ENABLED
+            if (!m_psz)
+                throw std::bad_alloc();
+#endif
             memcpy(m_psz, pcsz, m_cbAllocated);      // include 0 terminator
         }
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp	(revision 21392)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp	(revision 21393)
@@ -750,5 +750,5 @@
     }
 
-    if (rawdisk.isEmpty())
+    if (!rawdisk.length())
         return errorSyntax(USAGE_LISTPARTITIONS, "Mandatory parameter -rawdisk missing");
 
@@ -865,5 +865,5 @@
     if (filename.isEmpty())
         return errorSyntax(USAGE_CREATERAWVMDK, "Mandatory parameter -filename missing");
-    if (rawdisk.isEmpty())
+    if (!rawdisk.length())
         return errorSyntax(USAGE_CREATERAWVMDK, "Mandatory parameter -rawdisk missing");
     if (!pszPartitions && pszMBRFilename)
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp	(revision 21392)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp	(revision 21393)
@@ -167,8 +167,6 @@
     {
         HRESULT rc = S_OK;
-        Utf8Str utf8Name (name);
+        Utf8Str utf8Name(name);
         Guid uuid(machineId);
-        if (utf8Name.isNull())
-            rc = E_OUTOFMEMORY;
         if (   SUCCEEDED (rc)
             && uuid == mUuid
Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp	(revision 21392)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageImport.cpp	(revision 21393)
@@ -202,5 +202,5 @@
 
             case VINF_GETOPT_NOT_OPTION:
-                if (strOvfFilename.isEmpty())
+                if (!strOvfFilename.length())
                     strOvfFilename = ValueUnion.psz;
                 else
@@ -225,5 +225,5 @@
     }
 
-    if (strOvfFilename.isEmpty())
+    if (!strOvfFilename.length())
         return errorSyntax(USAGE_IMPORTAPPLIANCE, "Not enough arguments for \"import\" command.");
 
Index: /trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 21392)
+++ /trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp	(revision 21393)
@@ -1178,5 +1178,5 @@
     /* now the text */
     if (    mLabelFont != NULL
-         && !mSecureLabelText.isEmpty()
+         && mSecureLabelText.length()
        )
     {
Index: /trunk/src/VBox/Main/ApplianceImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ApplianceImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/ApplianceImpl.cpp	(revision 21393)
@@ -1370,6 +1370,6 @@
             /* If the there isn't any name specified create a default one out of
              * the OS type */
-            Utf8Str nameVBox = vsysThis.strName;
-            if (nameVBox.isEmpty())
+            Utf8Str nameVBox(vsysThis.strName);
+            if (!nameVBox.length())
                 nameVBox = strOsTypeVBox;
             searchUniqueVMName(nameVBox);
@@ -1380,5 +1380,5 @@
 
             /* VM Product */
-            if (!vsysThis.strProduct.isEmpty())
+            if (vsysThis.strProduct.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_Product,
                                     "",
@@ -1387,5 +1387,5 @@
 
             /* VM Vendor */
-            if (!vsysThis.strVendor.isEmpty())
+            if (vsysThis.strVendor.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_Vendor,
                                     "",
@@ -1394,5 +1394,5 @@
 
             /* VM Version */
-            if (!vsysThis.strVersion.isEmpty())
+            if (vsysThis.strVersion.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_Version,
                                     "",
@@ -1401,5 +1401,5 @@
 
             /* VM ProductUrl */
-            if (!vsysThis.strProductUrl.isEmpty())
+            if (vsysThis.strProductUrl.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_ProductUrl,
                                     "",
@@ -1408,5 +1408,5 @@
 
             /* VM VendorUrl */
-            if (!vsysThis.strVendorUrl.isEmpty())
+            if (vsysThis.strVendorUrl.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_VendorUrl,
                                     "",
@@ -1415,5 +1415,5 @@
 
             /* VM description */
-            if (!vsysThis.strDescription.isEmpty())
+            if (vsysThis.strDescription.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_Description,
                                     "",
@@ -1422,5 +1422,5 @@
 
             /* VM license */
-            if (!vsysThis.strLicenseText.isEmpty())
+            if (vsysThis.strLicenseText.length())
                 pNewDesc->addEntry(VirtualSystemDescriptionType_License,
                                     "",
@@ -1475,5 +1475,5 @@
 
             /* Audio */
-            if (!vsysThis.strSoundCardType.isNull())
+            if (vsysThis.strSoundCardType.length())
                 /* Currently we set the AC97 always.
                    @todo: figure out the hardware which could be possible */
@@ -2285,5 +2285,5 @@
                         ComPtr<IHardDisk> dstHdVBox;
                         /* If strHref is empty we have to create a new file */
-                        if (di.strHref.isEmpty())
+                        if (!di.strHref.length())
                         {
                             /* Which format to use? */
@@ -2928,9 +2928,9 @@
             std::list<VirtualSystemDescriptionEntry*> llVendorUrl = vsdescThis->findByType(VirtualSystemDescriptionType_VendorUrl);
             std::list<VirtualSystemDescriptionEntry*> llVersion = vsdescThis->findByType(VirtualSystemDescriptionType_Version);
-            bool fProduct = llProduct.size() && !llProduct.front()->strVbox.isEmpty();
-            bool fProductUrl = llProductUrl.size() && !llProductUrl.front()->strVbox.isEmpty();
-            bool fVendor = llVendor.size() && !llVendor.front()->strVbox.isEmpty();
-            bool fVendorUrl = llVendorUrl.size() && !llVendorUrl.front()->strVbox.isEmpty();
-            bool fVersion = llVersion.size() && !llVersion.front()->strVbox.isEmpty();
+            bool fProduct = llProduct.size() && (llProduct.front()->strVbox.length() > 0);
+            bool fProductUrl = llProductUrl.size() && (llProductUrl.front()->strVbox.length() > 0);
+            bool fVendor = llVendor.size() && (llVendor.front()->strVbox.length() > 0);
+            bool fVendorUrl = llVendorUrl.size() && (llVendorUrl.front()->strVbox.length() > 0);
+            bool fVersion = llVersion.size() && (llVersion.front()->strVbox.length() > 0);
             if (fProduct ||
                 fProductUrl ||
@@ -2972,6 +2972,7 @@
             // description
             std::list<VirtualSystemDescriptionEntry*> llDescription = vsdescThis->findByType(VirtualSystemDescriptionType_Description);
-            if (llDescription.size() &&
-                !llDescription.front()->strVbox.isEmpty())
+            if (    llDescription.size()
+                 && (llDescription.front()->strVbox.length() > 0)
+               )
             {
                 /*  <Section ovf:required="false" xsi:type="ovf:AnnotationSection_Type">
@@ -2995,6 +2996,7 @@
             // license
             std::list<VirtualSystemDescriptionEntry*> llLicense = vsdescThis->findByType(VirtualSystemDescriptionType_License);
-            if (llLicense.size() &&
-                !llLicense.front()->strVbox.isEmpty())
+            if (    llLicense.size()
+                 && (llLicense.front()->strVbox.length() > 0)
+               )
             {
                 /* <EulaSection>
@@ -3215,5 +3217,5 @@
                                 lBusNumber = 0;
 
-                                if (    desc.strVbox.isEmpty()      // AHCI is the default in VirtualBox
+                                if (    !desc.strVbox.length()      // AHCI is the default in VirtualBox
                                      || (!desc.strVbox.compare("ahci", Utf8Str::CaseInsensitive))
                                    )
@@ -3250,5 +3252,5 @@
                                 lBusNumber = 0;
 
-                                if (    desc.strVbox.isEmpty()      // LsiLogic is the default in VirtualBox
+                                if (    !desc.strVbox.length()      // LsiLogic is the default in VirtualBox
                                      || (!desc.strVbox.compare("lsilogic", Utf8Str::CaseInsensitive))
                                    )
@@ -3426,5 +3428,5 @@
                         // exactly this order, as stupid as it seems.
 
-                        if (!strCaption.isEmpty())
+                        if (strCaption.length())
                         {
                             pItem->createChild("rasd:Caption")->addContent(strCaption);
@@ -3433,5 +3435,5 @@
                         }
 
-                        if (!strDescription.isEmpty())
+                        if (strDescription.length())
                             pItem->createChild("rasd:Description")->addContent(strDescription);
 
@@ -3446,11 +3448,11 @@
                         // <rasd:ResourceType>3</rasd:ResourceType>
                         pItem->createChild("rasd:ResourceType")->addContent(Utf8StrFmt("%d", type));
-                        if (!strResourceSubType.isEmpty())
+                        if (strResourceSubType.length())
                             pItem->createChild("rasd:ResourceSubType")->addContent(strResourceSubType);
 
-                        if (!strHostResource.isEmpty())
+                        if (strHostResource.length())
                             pItem->createChild("rasd:HostResource")->addContent(strHostResource);
 
-                        if (!strAllocationUnits.isEmpty())
+                        if (strAllocationUnits.length())
                             pItem->createChild("rasd:AllocationUnits")->addContent(strAllocationUnits);
 
@@ -3462,5 +3464,5 @@
                             pItem->createChild("rasd:AutomaticAllocation")->addContent( (lAutomaticAllocation) ? "true" : "false" );
 
-                        if (!strConnection.isEmpty())
+                        if (strConnection.length())
                             pItem->createChild("rasd:Connection")->addContent(strConnection);
 
@@ -3649,5 +3651,5 @@
     }
     /* If there is no bucket name provided reject the upload */
-    if (bucket.isEmpty())
+    if (!bucket.length())
         return setError(E_INVALIDARG,
                         tr("You doesn't provide a bucket name in the URI"), tmpPath.c_str());
Index: /trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 21393)
@@ -1084,7 +1084,12 @@
     for (unsigned i = 0; i < 10 && (VERR_BUFFER_OVERFLOW == vrc); ++i)
     {
-        Utf8Buf.reserve(cchBuf + 1024);
-        if (Utf8Buf.isNull())
+        try
+        {
+            Utf8Buf.reserve(cchBuf + 1024);
+        }
+        catch(...)
+        {
             return E_OUTOFMEMORY;
+        }
         parm[1].type = VBOX_HGCM_SVC_PARM_PTR;
         parm[1].u.pointer.addr = Utf8Buf.mutableRaw();
@@ -3871,40 +3876,46 @@
     using namespace guestProp;
 
-    VBOXHGCMSVCPARM parm[4];
-    Utf8Str Utf8Name = aName;
-    AssertReturn(!Utf8Name.isNull(), E_OUTOFMEMORY);
-    char pszBuffer[MAX_VALUE_LEN + MAX_FLAGS_LEN];
-
-    parm[0].type = VBOX_HGCM_SVC_PARM_PTR;
-    parm[0].u.pointer.addr = (void*)Utf8Name.c_str();
-    /* The + 1 is the null terminator */
-    parm[0].u.pointer.size = (uint32_t)Utf8Name.length() + 1;
-    parm[1].type = VBOX_HGCM_SVC_PARM_PTR;
-    parm[1].u.pointer.addr = pszBuffer;
-    parm[1].u.pointer.size = sizeof(pszBuffer);
-    int vrc = mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", GET_PROP_HOST,
-                                     4, &parm[0]);
-    /* The returned string should never be able to be greater than our buffer */
-    AssertLogRel (vrc != VERR_BUFFER_OVERFLOW);
-    AssertLogRel (RT_FAILURE(vrc) || VBOX_HGCM_SVC_PARM_64BIT == parm[2].type);
-    if (RT_SUCCESS (vrc) || (VERR_NOT_FOUND == vrc))
-    {
-        rc = S_OK;
-        if (vrc != VERR_NOT_FOUND)
-        {
-            Utf8Str strBuffer(pszBuffer);
-            strBuffer.cloneTo(aValue);
-
-            *aTimestamp = parm[2].u.uint64;
-
-            size_t iFlags = strBuffer.length() + 1;
-            Utf8Str(pszBuffer + iFlags).cloneTo(aFlags);
+    try
+    {
+        VBOXHGCMSVCPARM parm[4];
+        Utf8Str Utf8Name = aName;
+        char pszBuffer[MAX_VALUE_LEN + MAX_FLAGS_LEN];
+
+        parm[0].type = VBOX_HGCM_SVC_PARM_PTR;
+        parm[0].u.pointer.addr = (void*)Utf8Name.c_str();
+        /* The + 1 is the null terminator */
+        parm[0].u.pointer.size = (uint32_t)Utf8Name.length() + 1;
+        parm[1].type = VBOX_HGCM_SVC_PARM_PTR;
+        parm[1].u.pointer.addr = pszBuffer;
+        parm[1].u.pointer.size = sizeof(pszBuffer);
+        int vrc = mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", GET_PROP_HOST,
+                                        4, &parm[0]);
+        /* The returned string should never be able to be greater than our buffer */
+        AssertLogRel (vrc != VERR_BUFFER_OVERFLOW);
+        AssertLogRel (RT_FAILURE(vrc) || VBOX_HGCM_SVC_PARM_64BIT == parm[2].type);
+        if (RT_SUCCESS (vrc) || (VERR_NOT_FOUND == vrc))
+        {
+            rc = S_OK;
+            if (vrc != VERR_NOT_FOUND)
+            {
+                Utf8Str strBuffer(pszBuffer);
+                strBuffer.cloneTo(aValue);
+
+                *aTimestamp = parm[2].u.uint64;
+
+                size_t iFlags = strBuffer.length() + 1;
+                Utf8Str(pszBuffer + iFlags).cloneTo(aFlags);
+            }
+            else
+                aValue = NULL;
         }
         else
-            aValue = NULL;
-    }
-    else
-        rc = setError (E_UNEXPECTED,
-            tr ("The service call failed with the error %Rrc"), vrc);
+            rc = setError (E_UNEXPECTED,
+                tr ("The service call failed with the error %Rrc"), vrc);
+    }
+    catch(std::bad_alloc &e)
+    {
+        rc = E_OUTOFMEMORY;
+    }
     return rc;
 #endif /* else !defined (VBOX_WITH_GUEST_PROPS) */
@@ -4392,5 +4403,5 @@
 
     /* make sure the Logs folder exists */
-    Assert (!logDir.isEmpty());
+    Assert(logDir.length());
     if (!RTDirExists (logDir))
         RTDirCreateFullPath (logDir, 0777);
@@ -6191,5 +6202,5 @@
 
     /* append to the existing error message if any */
-    if (!task->mErrorMsg.isEmpty())
+    if (task->mErrorMsg.length())
         task->mErrorMsg = Utf8StrFmt ("%s.\n%N (%Rrc)", task->mErrorMsg.raw(),
                                       pszFormat, &va2, rc, rc);
@@ -6666,5 +6677,5 @@
 
                 /* Load saved state? */
-                if (!task->mSavedStateFile.isEmpty())
+                if (task->mSavedStateFile.length())
                 {
                     LogFlowFunc (("Restoring saved state from '%s'...\n",
@@ -6749,5 +6760,5 @@
              * this function is not updated.
              */
-            if (task->mErrorMsg.isNull())
+            if (!task->mErrorMsg.length())
             {
                 /* If the error message is not set but we've got a failure,
@@ -7095,6 +7106,6 @@
     AssertReturn (task.get(), VERR_INVALID_PARAMETER);
 
-    Assert (!task->mSavedStateFile.isNull());
-    Assert (!task->mProgress.isNull());
+    Assert(task->mSavedStateFile.length());
+    Assert(!task->mProgress.isNull());
 
     const ComObjPtr <Console> &that = task->mConsole;
@@ -7252,7 +7263,9 @@
     else
     {
-        if (!errMsg.isNull())
-            task->mProgress->notifyComplete (rc,
-                COM_IIDOF(IConsole), Console::getComponentName(), errMsg);
+        if (errMsg.length())
+            task->mProgress->notifyComplete(rc,
+                                            COM_IIDOF(IConsole),
+                                            Console::getComponentName(),
+                                            errMsg);
         else
             task->mProgress->notifyComplete (rc);
Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 21393)
@@ -1801,4 +1801,5 @@
      * Guest property service
      */
+    try
     {
         /* Load the service */
@@ -1844,11 +1845,4 @@
                 timestamps.push_back(timestampsOut[i]);
                 utf8Flags.push_back(Bstr(flagsOut[i]));
-#if 0 /** @todo r=bird: Who is gonna catch this? Why does it trigger now? */
-                if (   utf8Names.back().isNull()
-                    || utf8Values.back().isNull()
-                    || utf8Flags.back().isNull()
-                   )
-                    throw std::bad_alloc();
-#endif
             }
             for (unsigned i = 0; i < cProps && RT_SUCCESS(rc); ++i)
@@ -1889,4 +1883,8 @@
             Log(("Set VBoxGuestPropSvc property store\n"));
         }
+    }
+    catch(std::bad_alloc &e)
+    {
+        return VERR_NO_MEMORY;
     }
 #endif /* VBOX_WITH_GUEST_PROPS defined */
Index: /trunk/src/VBox/Main/DHCPServerRunner.cpp
===================================================================
--- /trunk/src/VBox/Main/DHCPServerRunner.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/DHCPServerRunner.cpp	(revision 21393)
@@ -97,12 +97,9 @@
     for (unsigned i = 0; i < DHCPCFG_NOTOPT_MAXVAL; i++)
     {
-        if (!mOptions[i].isNull())
+        if (mOptions[i].length())
         {
             const ARGDEF * pArgDef = getArgDef((DHCPCFG)i);
-            args[index++] = pArgDef->Name;
-            if (!mOptions[i].isEmpty())
-            {
-                args[index++] = mOptions[i].raw();
-            }
+            args[index++] = pArgDef->Name;      // e.g. "--network"
+            args[index++] = mOptions[i].raw();  // value
         }
     }
Index: /trunk/src/VBox/Main/HardDiskImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HardDiskImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/HardDiskImpl.cpp	(revision 21393)
@@ -3570,5 +3570,5 @@
     Utf8Str error;
 
-    if (mm.vdError.isEmpty())
+    if (!mm.vdError.length())
         error = Utf8StrFmt (" (%Rrc)", aVRC);
     else
@@ -3603,5 +3603,5 @@
     AssertReturnVoid (that != NULL);
 
-    if (that->mm.vdError.isEmpty())
+    if (!that->mm.vdError.length())
         that->mm.vdError =
             Utf8StrFmt ("%s (%Rrc)", Utf8StrFmtVA (pszFormat, va).raw(), rc);
Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 21393)
@@ -1408,5 +1408,5 @@
     Utf8Str snapshotFolder = aSnapshotFolder;
 
-    if (snapshotFolder.isEmpty())
+    if (!snapshotFolder.length())
     {
         if (isInOwnDir())
@@ -2780,6 +2780,6 @@
         Utf8Str logFolder;
         getLogFolder (logFolder);
-        Assert (!logFolder.isEmpty());
-        if (RTDirExists (logFolder))
+        Assert(logFolder.length());
+        if (RTDirExists(logFolder))
         {
             /* Delete all VBox.log[.N] files from the Logs folder
@@ -2805,8 +2805,8 @@
          * there (we don't check for errors because the user might have
          * some private files there that we don't want to delete) */
-        Utf8Str snapshotFolder = mUserData->mSnapshotFolderFull;
-        Assert (!snapshotFolder.isEmpty());
-        if (RTDirExists (snapshotFolder))
-            RTDirRemove (snapshotFolder);
+        Utf8Str snapshotFolder(mUserData->mSnapshotFolderFull);
+        Assert(snapshotFolder.length());
+        if (RTDirExists(snapshotFolder))
+            RTDirRemove(snapshotFolder);
 
         /* delete the directory that contains the settings file, but only
@@ -3056,5 +3056,7 @@
 }
 
-STDMETHODIMP Machine::SetGuestProperty (IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags)
+STDMETHODIMP Machine::SetGuestProperty(IN_BSTR aName,
+                                       IN_BSTR aValue,
+                                       IN_BSTR aFlags)
 {
 #if !defined (VBOX_WITH_GUEST_PROPS)
@@ -3068,114 +3070,122 @@
         return E_INVALIDARG;
 
-    Utf8Str utf8Name (aName);
-    Utf8Str utf8Flags (aFlags);
-    Utf8Str utf8Patterns (mHWData->mGuestPropertyNotificationPatterns);
-    if (   utf8Name.isNull()
-        || ((aFlags != NULL) && utf8Flags.isNull())
-        || utf8Patterns.isNull()
-       )
-        return E_OUTOFMEMORY;
-    bool matchAll = false;
-    if (0 == utf8Patterns.length())
-        matchAll = true;
-
-    uint32_t fFlags = NILFLAG;
-    if ((aFlags != NULL) && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags))
-       )
-        return setError (E_INVALIDARG, tr ("Invalid flag values: '%ls'"),
-                aFlags);
-
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
-
-    AutoWriteLock alock (this);
-
-    HRESULT rc = checkStateDependency (MutableStateDep);
-    CheckComRCReturnRC (rc);
-
-    rc = S_OK;
-
-    if (!mHWData->mPropertyServiceActive)
-    {
-        bool found = false;
-        HWData::GuestProperty property;
-        property.mFlags = NILFLAG;
-        if (fFlags & TRANSIENT)
-            rc = setError (VBOX_E_INVALID_OBJECT_STATE,
-                tr ("Cannot set a transient property when the "
-                    "machine is not running"));
-        if (SUCCEEDED (rc))
-        {
-            for (HWData::GuestPropertyList::iterator it =
-                    mHWData->mGuestProperties.begin();
-                 it != mHWData->mGuestProperties.end(); ++ it)
-                if (it->mName == aName)
+    HRESULT rc = S_OK;
+
+    try
+    {
+        Utf8Str utf8Name(aName);
+        Utf8Str utf8Flags(aFlags);
+        Utf8Str utf8Patterns(mHWData->mGuestPropertyNotificationPatterns);
+
+        bool matchAll = false;
+        if (0 == utf8Patterns.length())
+            matchAll = true;
+
+        uint32_t fFlags = NILFLAG;
+        if (    (aFlags != NULL)
+             && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags))
+           )
+            return setError(E_INVALIDARG,
+                            tr("Invalid flag values: '%ls'"),
+                            aFlags);
+
+        AutoCaller autoCaller(this);
+        CheckComRCReturnRC(autoCaller.rc());
+
+        AutoWriteLock alock(this);
+
+        rc = checkStateDependency(MutableStateDep);
+        CheckComRCReturnRC (rc);
+
+        rc = S_OK;
+
+        if (!mHWData->mPropertyServiceActive)
+        {
+            bool found = false;
+            HWData::GuestProperty property;
+            property.mFlags = NILFLAG;
+            if (fFlags & TRANSIENT)
+                rc = setError(VBOX_E_INVALID_OBJECT_STATE,
+                              tr("Cannot set a transient property when the machine is not running"));
+
+            if (SUCCEEDED (rc))
+            {
+                for (HWData::GuestPropertyList::iterator it =
+                        mHWData->mGuestProperties.begin();
+                    it != mHWData->mGuestProperties.end(); ++ it)
+                    if (it->mName == aName)
+                    {
+                        property = *it;
+                        if (it->mFlags & (RDONLYHOST))
+                            rc = setError (E_ACCESSDENIED,
+                                tr ("The property '%ls' cannot be changed by the host"),
+                                aName);
+                        else
+                        {
+                            mHWData.backup();
+                            /* The backup() operation invalidates our iterator, so
+                            * get a new one. */
+                            for (it = mHWData->mGuestProperties.begin();
+                                it->mName != aName; ++ it)
+                                ;
+                            mHWData->mGuestProperties.erase (it);
+                        }
+                        found = true;
+                        break;
+                    }
+            }
+            if (found && SUCCEEDED (rc))
+            {
+                if (*aValue)
                 {
-                    property = *it;
-                    if (it->mFlags & (RDONLYHOST))
-                        rc = setError (E_ACCESSDENIED,
-                            tr ("The property '%ls' cannot be changed by the host"),
-                            aName);
-                    else
-                    {
-                        mHWData.backup();
-                        /* The backup() operation invalidates our iterator, so
-                         * get a new one. */
-                        for (it = mHWData->mGuestProperties.begin();
-                            it->mName != aName; ++ it)
-                            ;
-                        mHWData->mGuestProperties.erase (it);
-                    }
-                    found = true;
-                    break;
+                    RTTIMESPEC time;
+                    property.mValue = aValue;
+                    property.mTimestamp = RTTimeSpecGetNano (RTTimeNow (&time));
+                    if (aFlags != NULL)
+                        property.mFlags = fFlags;
+                    mHWData->mGuestProperties.push_back (property);
                 }
-        }
-        if (found && SUCCEEDED (rc))
-        {
-            if (*aValue)
+            }
+            else if (SUCCEEDED (rc) && *aValue)
             {
                 RTTIMESPEC time;
+                mHWData.backup();
+                property.mName = aName;
                 property.mValue = aValue;
                 property.mTimestamp = RTTimeSpecGetNano (RTTimeNow (&time));
-                if (aFlags != NULL)
-                    property.mFlags = fFlags;
+                property.mFlags = fFlags;
                 mHWData->mGuestProperties.push_back (property);
             }
-        }
-        else if (SUCCEEDED (rc) && *aValue)
-        {
-            RTTIMESPEC time;
-            mHWData.backup();
-            property.mName = aName;
-            property.mValue = aValue;
-            property.mTimestamp = RTTimeSpecGetNano (RTTimeNow (&time));
-            property.mFlags = fFlags;
-            mHWData->mGuestProperties.push_back (property);
-        }
-        if (   SUCCEEDED (rc)
-            && (   matchAll
-                || RTStrSimplePatternMultiMatch (utf8Patterns.raw(), RTSTR_MAX,
-                                                utf8Name.raw(), RTSTR_MAX, NULL)
-              )
-          )
-            mParent->onGuestPropertyChange (mData->mUuid, aName, aValue, aFlags);
-    }
-    else
-    {
-        ComPtr <IInternalSessionControl> directControl =
-            mData->mSession.mDirectControl;
-
-        /* just be on the safe side when calling another process */
-        alock.leave();
-
-        BSTR dummy = NULL;
-        ULONG64 dummy64;
-        if (!directControl)
-            rc = E_FAIL;
+            if (   SUCCEEDED (rc)
+                && (   matchAll
+                    || RTStrSimplePatternMultiMatch (utf8Patterns.raw(), RTSTR_MAX,
+                                                    utf8Name.raw(), RTSTR_MAX, NULL)
+                )
+            )
+                mParent->onGuestPropertyChange (mData->mUuid, aName, aValue, aFlags);
+        }
         else
-            rc = directControl->AccessGuestProperty (aName, aValue, aFlags,
-                                                     true /* isSetter */,
-                                                     &dummy, &dummy64, &dummy);
-    }
+        {
+            ComPtr <IInternalSessionControl> directControl =
+                mData->mSession.mDirectControl;
+
+            /* just be on the safe side when calling another process */
+            alock.leave();
+
+            BSTR dummy = NULL;
+            ULONG64 dummy64;
+            if (!directControl)
+                rc = E_FAIL;
+            else
+                rc = directControl->AccessGuestProperty(aName, aValue, aFlags,
+                                                        true /* isSetter */,
+                                                        &dummy, &dummy64, &dummy);
+        }
+    }
+    catch (std::bad_alloc &e)
+    {
+        rc = E_OUTOFMEMORY;
+    }
+
     return rc;
 #endif /* else !defined (VBOX_WITH_GUEST_PROPS) */
@@ -5401,4 +5411,5 @@
 #ifdef VBOX_WITH_GUEST_PROPS
     /* Guest properties (optional) */
+    try
     {
         using namespace guestProp;
@@ -5422,7 +5433,5 @@
                 /* property flags (optional, defaults to empty) */
                 Bstr flags = (*it).stringValue ("flags");
-                Utf8Str utf8Flags (flags);
-                if (utf8Flags.isNull ())
-                    return E_OUTOFMEMORY;
+                Utf8Str utf8Flags(flags);
                 validateFlags (utf8Flags.raw(), &fFlags);
                 HWData::GuestProperty property = { name, value, timestamp, fFlags };
@@ -5442,4 +5451,8 @@
         if (mHWData->mGuestPropertyNotificationPatterns.isNull ())
             return E_OUTOFMEMORY;
+    }
+    catch(std::bad_alloc &e)
+    {
+        return E_OUTOFMEMORY;
     }
 #endif /* VBOX_WITH_GUEST_PROPS defined */
@@ -9616,51 +9629,52 @@
         return E_POINTER;  /* aValue can be NULL to indicate deletion */
 
-    Utf8Str utf8Name (aName);
-    Utf8Str utf8Flags (aFlags);
-    Utf8Str utf8Patterns (mHWData->mGuestPropertyNotificationPatterns);
-    if (   utf8Name.isNull()
-        || ((aFlags != NULL) && utf8Flags.isNull())
-        || utf8Patterns.isNull()
-       )
+    try
+    {
+        Utf8Str utf8Name(aName);
+        Utf8Str utf8Flags(aFlags);
+        Utf8Str utf8Patterns(mHWData->mGuestPropertyNotificationPatterns);
+
+        uint32_t fFlags = NILFLAG;
+        if ((aFlags != NULL) && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags)))
+            return E_INVALIDARG;
+
+        bool matchAll = false;
+        if (utf8Patterns.length() == 0)
+            matchAll = true;
+
+        AutoCaller autoCaller (this);
+        CheckComRCReturnRC (autoCaller.rc());
+
+        AutoWriteLock alock (this);
+
+        HRESULT rc = checkStateDependency (MutableStateDep);
+        CheckComRCReturnRC (rc);
+
+        mHWData.backup();
+        for (HWData::GuestPropertyList::iterator iter = mHWData->mGuestProperties.begin();
+            iter != mHWData->mGuestProperties.end(); ++iter)
+            if (aName == iter->mName)
+            {
+                mHWData->mGuestProperties.erase (iter);
+                break;
+            }
+        if (aValue != NULL)
+        {
+            HWData::GuestProperty property = { aName, aValue, aTimestamp, fFlags };
+            mHWData->mGuestProperties.push_back (property);
+        }
+
+        /* send a callback notification if appropriate */
+        alock.leave();
+        if (   matchAll
+            || RTStrSimplePatternMultiMatch (utf8Patterns.raw(), RTSTR_MAX,
+                                            utf8Name.raw(), RTSTR_MAX, NULL)
+        )
+            mParent->onGuestPropertyChange (mData->mUuid, aName, aValue, aFlags);
+    }
+    catch(std::bad_alloc &e)
+    {
         return E_OUTOFMEMORY;
-
-    uint32_t fFlags = NILFLAG;
-    if ((aFlags != NULL) && RT_FAILURE (validateFlags (utf8Flags.raw(), &fFlags)))
-        return E_INVALIDARG;
-
-    bool matchAll = false;
-    if (utf8Patterns.length() == 0)
-        matchAll = true;
-
-    AutoCaller autoCaller (this);
-    CheckComRCReturnRC (autoCaller.rc());
-
-    AutoWriteLock alock (this);
-
-    HRESULT rc = checkStateDependency (MutableStateDep);
-    CheckComRCReturnRC (rc);
-
-    mHWData.backup();
-    for (HWData::GuestPropertyList::iterator iter = mHWData->mGuestProperties.begin();
-         iter != mHWData->mGuestProperties.end(); ++iter)
-        if (aName == iter->mName)
-        {
-            mHWData->mGuestProperties.erase (iter);
-            break;
-        }
-    if (aValue != NULL)
-    {
-        HWData::GuestProperty property = { aName, aValue, aTimestamp, fFlags };
-        mHWData->mGuestProperties.push_back (property);
-    }
-
-    /* send a callback notification if appropriate */
-    alock.leave();
-    if (   matchAll
-        || RTStrSimplePatternMultiMatch (utf8Patterns.raw(), RTSTR_MAX,
-                                         utf8Name.raw(), RTSTR_MAX, NULL)
-       )
-        mParent->onGuestPropertyChange (mData->mUuid, aName, aValue, aFlags);
-
+    }
     return S_OK;
 #else
Index: /trunk/src/VBox/Main/SnapshotImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/SnapshotImpl.cpp	(revision 21393)
@@ -412,5 +412,5 @@
 
     /* state file may be NULL (for offline snapshots) */
-    if (    !path.isEmpty()
+    if (    path.length()
          && RTPathStartsWith(path, aOldPath)
        )
Index: /trunk/src/VBox/Main/VFSExplorerImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VFSExplorerImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/VFSExplorerImpl.cpp	(revision 21393)
@@ -403,5 +403,5 @@
         RTS3SetProgressCallback(hS3, VFSExplorer::TaskVFSExplorer::uploadProgress, &aTask);
         /* Do we need the list of buckets or keys? */
-        if (m->strBucket.isEmpty())
+        if (!m->strBucket.length())
         {
             PCRTS3BUCKETENTRY pBuckets = NULL;
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 21393)
@@ -3481,17 +3481,18 @@
     AutoReadLock hardDiskLock (aHardDisk);
 
-    Utf8Str conflict;
-    HRESULT rc = checkMediaForConflicts2 (aHardDisk->id(),
-                                          aHardDisk->locationFull(),
-                                          conflict);
+    Utf8Str strConflict;
+    HRESULT rc = checkMediaForConflicts2(aHardDisk->id(),
+                                         aHardDisk->locationFull(),
+                                         strConflict);
     CheckComRCReturnRC (rc);
 
-    if (!conflict.isNull())
-    {
-        return setError (E_INVALIDARG,
-            tr ("Cannot register the hard disk '%ls' with UUID {%RTuuid} "
-                "because a %s already exists in the media registry ('%ls')"),
-            aHardDisk->locationFull().raw(), aHardDisk->id().raw(),
-            conflict.raw(), mData.mCfgFile.mName.raw());
+    if (strConflict.length())
+    {
+        return setError(E_INVALIDARG,
+                        tr("Cannot register the hard disk '%ls' with UUID {%RTuuid} because a %s already exists in the media registry ('%ls')"),
+                        aHardDisk->locationFull().raw(),
+                        aHardDisk->id().raw(),
+                        strConflict.raw(),
+                        mData.mCfgFile.mName.raw());
     }
 
@@ -3598,16 +3599,18 @@
     AutoReadLock imageLock (aImage);
 
-    Utf8Str conflict;
-    HRESULT rc = checkMediaForConflicts2 (aImage->id(), aImage->locationFull(),
-                                          conflict);
+    Utf8Str strConflict;
+    HRESULT rc = checkMediaForConflicts2(aImage->id(),
+                                         aImage->locationFull(),
+                                         strConflict);
     CheckComRCReturnRC (rc);
 
-    if (!conflict.isNull())
-    {
-        return setError (VBOX_E_INVALID_OBJECT_STATE,
-            tr ("Cannot register the CD/DVD image '%ls' with UUID {%RTuuid} "
-                "because a %s already exists in the media registry ('%ls')"),
-            aImage->locationFull().raw(), aImage->id().raw(),
-            conflict.raw(), mData.mCfgFile.mName.raw());
+    if (strConflict.length())
+    {
+        return setError(VBOX_E_INVALID_OBJECT_STATE,
+                        tr("Cannot register the CD/DVD image '%ls' with UUID {%RTuuid} because a %s already exists in the media registry ('%ls')"),
+                        aImage->locationFull().raw(),
+                        aImage->id().raw(),
+                        strConflict.raw(),
+                        mData.mCfgFile.mName.raw());
     }
 
@@ -3699,16 +3702,18 @@
     AutoReadLock imageLock (aImage);
 
-    Utf8Str conflict;
-    HRESULT rc = checkMediaForConflicts2 (aImage->id(), aImage->locationFull(),
-                                          conflict);
+    Utf8Str strConflict;
+    HRESULT rc = checkMediaForConflicts2(aImage->id(),
+                                         aImage->locationFull(),
+                                         strConflict);
     CheckComRCReturnRC (rc);
 
-    if (!conflict.isNull())
-    {
-        return setError (VBOX_E_INVALID_OBJECT_STATE,
-            tr ("Cannot register the floppy image '%ls' with UUID {%RTuuid} "
-                "because a %s already exists in the media registry ('%ls')"),
-            aImage->locationFull().raw(), aImage->id().raw(),
-            conflict.raw(), mData.mCfgFile.mName.raw());
+    if (strConflict.length())
+    {
+        return setError(VBOX_E_INVALID_OBJECT_STATE,
+                        tr("Cannot register the floppy image '%ls' with UUID {%RTuuid} because a %s already exists in the media registry ('%ls')"),
+                        aImage->locationFull().raw(),
+                        aImage->id().raw(),
+                        strConflict.raw(),
+                        mData.mCfgFile.mName.raw());
     }
 
@@ -3937,5 +3942,5 @@
         {
             *aFormatVersion = aTree.oldVersion();
-            if (aFormatVersion->isNull())
+            if (!aFormatVersion->length())
                 *aFormatVersion = VBOX_XML_VERSION_FULL;
         }
Index: /trunk/src/VBox/Main/glue/string.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/string.cpp	(revision 21392)
+++ /trunk/src/VBox/Main/glue/string.cpp	(revision 21393)
@@ -139,5 +139,5 @@
 Utf8Str& Utf8Str::toLower()
 {
-    if (!isEmpty())
+    if (length())
         ::RTStrToLower(m_psz);
     return *this;
@@ -146,5 +146,5 @@
 Utf8Str& Utf8Str::toUpper()
 {
-    if (!isEmpty())
+    if (length())
         ::RTStrToUpper(m_psz);
     return *this;
Index: /trunk/src/VBox/Main/include/HostHardwareLinux.h
===================================================================
--- /trunk/src/VBox/Main/include/HostHardwareLinux.h	(revision 21392)
+++ /trunk/src/VBox/Main/include/HostHardwareLinux.h	(revision 21393)
@@ -66,5 +66,5 @@
             mDescription (aDescription != NULL ? aDescription : std::string ()) {}
     };
-    
+
     /** List (resp vector) holding drive information */
     typedef std::vector <DriveInfo> DriveInfoList;
@@ -144,5 +144,5 @@
         USBDeviceInfo () {}
     };
-    
+
     /** List (resp vector) holding drive information */
     typedef std::vector <USBDeviceInfo> DeviceInfoList;
Index: /trunk/src/VBox/Runtime/testcase/tstUtf8.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstUtf8.cpp	(revision 21392)
+++ /trunk/src/VBox/Runtime/testcase/tstUtf8.cpp	(revision 21393)
@@ -987,8 +987,8 @@
 
     copy1 = NULL;
-    CHECK( (copy1.isNull()) );
+    CHECK( (copy1.length() == 0) );
 
     copy1 = "";
-    CHECK( (copy1.isEmpty()) );
+    CHECK( (copy1.length() == 0) );
 
     CHECK( (ministring("abc") < ministring("def")) );
