Index: /trunk/src/VBox/VMM/CFGM.cpp
===================================================================
--- /trunk/src/VBox/VMM/CFGM.cpp	(revision 10701)
+++ /trunk/src/VBox/VMM/CFGM.cpp	(revision 10702)
@@ -597,5 +597,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu64            Where to store the integer value.
+ * @param   pu64            Where to store the integer value. This is set to the default on failure.
  * @param   u64Def          The default value.
  */
@@ -611,9 +611,12 @@
             rc = VERR_CFGM_NOT_INTEGER;
     }
-    else if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
+
+    if (RT_FAILURE(rc))
     {
         *pu64 = u64Def;
-        rc = VINF_SUCCESS;
-    }
+        if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
+            rc = VINF_SUCCESS;
+    }
+
     return rc;
 }
@@ -658,5 +661,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of a zero terminate character value.
- * @param   pszString       Where to store the string.
+ * @param   pszString       Where to store the string. This will not be set on overflow error.
  * @param   cchString       Size of the string buffer. (Includes terminator.)
  * @param   pszDef          The default value.
@@ -681,5 +684,6 @@
             rc = VERR_CFGM_NOT_STRING;
     }
-    else if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
+
+    if (RT_FAILURE(rc) && rc != VERR_CFGM_NOT_ENOUGH_SPACE)
     {
         size_t cchDef = strlen(pszDef);
@@ -688,9 +692,11 @@
             memcpy(pszString, pszDef, cchDef);
             memset(pszString + cchDef, 0, cchString - cchDef);
-            rc = VINF_SUCCESS;
+            if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
+                rc = VINF_SUCCESS;
         }
-        else
+        else if (rc == VERR_CFGM_VALUE_NOT_FOUND || rc == VERR_CFGM_NO_PARENT)
             rc = VERR_CFGM_NOT_ENOUGH_SPACE;
     }
+
     return rc;
 }
@@ -1703,5 +1709,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu64            Where to store the integer value.
+ * @param   pu64            Where to store the integer value. Set to default on failure.
  * @param   u64Def          The default value.
  */
@@ -1736,5 +1742,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pi64            Where to store the value.
+ * @param   pi64            Where to store the value. Set to default on failure.
  * @param   i64Def          The default value.
  */
@@ -1778,5 +1784,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu32            Where to store the value.
+ * @param   pu32            Where to store the value. Set to default on failure.
  * @param   u32Def          The default value.
  */
@@ -1826,5 +1832,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pi32            Where to store the value.
+ * @param   pi32            Where to store the value. Set to default on failure.
  * @param   i32Def          The default value.
  */
@@ -1874,5 +1880,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu16            Where to store the value.
+ * @param   pu16            Where to store the value. Set to default on failure.
  * @param   i16Def          The default value.
  */
@@ -1922,5 +1928,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pi16            Where to store the value.
+ * @param   pi16            Where to store the value. Set to default on failure.
  * @param   i16Def          The default value.
  */
@@ -1970,5 +1976,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu8             Where to store the value.
+ * @param   pu8             Where to store the value. Set to default on failure.
  * @param   u8Def           The default value.
  */
@@ -2018,5 +2024,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pi8             Where to store the value.
+ * @param   pi8             Where to store the value. Set to default on failure.
  * @param   i8Def           The default value.
  */
@@ -2062,5 +2068,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pf              Where to store the value.
+ * @param   pf              Where to store the value. Set to default on failure.
  * @param   fDef            The default value.
  * @remark  This function will interpret any non-zero value as true.
@@ -2097,5 +2103,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pPort           Where to store the value.
+ * @param   pPort           Where to store the value. Set to default on failure.
  * @param   PortDef         The default value.
  */
@@ -2128,5 +2134,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pu              Where to store the value.
+ * @param   pu              Where to store the value. Set to default on failure.
  * @param   uDef            The default value.
  */
@@ -2159,5 +2165,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pi              Where to store the value.
+ * @param   pi              Where to store the value. Set to default on failure.
  * @param   iDef            The default value.
  */
@@ -2199,5 +2205,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   ppv             Where to store the value.
+ * @param   ppv             Where to store the value. Set to default on failure.
  * @param   pvDef           The default value.
  */
@@ -2248,5 +2254,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pGCPtr          Where to store the value.
+ * @param   pGCPtr          Where to store the value. Set to default on failure.
  * @param   GCPtrDef        The default value.
  */
@@ -2297,5 +2303,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pGCPtr          Where to store the value.
+ * @param   pGCPtr          Where to store the value. Set to default on failure.
  * @param   GCPtrDef        The default value.
  */
@@ -2346,5 +2352,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Name of an integer value.
- * @param   pGCPtr          Where to store the value.
+ * @param   pGCPtr          Where to store the value. Set to default on failure.
  * @param   GCPtrDef        The default value.
  */
@@ -2404,5 +2410,5 @@
  * @param   pNode           Which node to search for pszName in.
  * @param   pszName         Value name. This value must be of zero terminated character string type.
- * @param   ppszString      Where to store the string pointer.
+ * @param   ppszString      Where to store the string pointer. Not set on failure.
  *                          Free this using MMR3HeapFree().
  */
