Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 14931)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 14934)
@@ -322,4 +322,16 @@
   </result>
 
+  <result name="VBOX_E_XML_ERROR" value="0x80BB000A">
+    <desc>
+      Invalid XML found.
+    </desc>
+  </result>
+
+  <result name="VBOX_E_INVALID_SESSION_STATE" value="0x80BB000B">
+    <desc>
+      Current session state prohibits operation.
+    </desc>
+  </result>
+
   <!--
     Note that src/VBox/Runtime/common/err/errmsgvboxcom.xsl will ignore
@@ -1787,6 +1799,6 @@
         </note>
 
-        <result name="VBOX_E_FILE_ERROR">
-          Image conflicts with another in the media registry.
+        <result name="VBOX_E_INVALID_OBJECT_STATE">
+          CD/DVD image already exists in the media registry.
         </result>
 
@@ -1816,4 +1828,9 @@
         installation, i.e. it must be previously opened by <link
         to="#openDVDImage()"/>, or mounted to some known virtual machine.
+
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No matching DVD image found in the media registry.
+        </result>
+
       </desc>
       <param name="id" type="uuid" dir="in">
@@ -1835,4 +1852,103 @@
         The search is done by comparing the value of the @a location argument to
         the <link to="IMedium::location"/> attribute of each known CD/DVD image.
+
+        The requested location can be a path relative to the
+        <link to="IVirtualBox::homeFolder">VirtualBox home folder</link>. If
+        only a file name without any path is given, the
+        <link to="ISystemProperties::defaultHardDiskFolder"> default hard disk
+        folder</link> will be prepended to the file name before searching. Note
+        that on case sensitive file systems, a case sensitive comparison is
+        performed, otherwise the case in the file path is ignored.
+
+        <result name="VBOX_E_FILE_ERROR">
+          Invalid image file location.
+        </result>
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No matching DVD image found in the media registry.
+        </result>
+
+      </desc>
+      <param name="location" type="wstring" dir="in">
+        <desc>CD/DVD image file path to look for.</desc>
+      </param>
+      <param name="image" type="IDVDImage2" dir="return">
+        <desc>Found CD/DVD image object.</desc>
+      </param>
+    </method>
+
+    <method name="openFloppyImage">
+      <desc>
+        Opens a floppy image contained in the specified file of the supported
+        format and assigns it the given UUID.
+
+        After the image is successfully opened by this method, it gets
+        remembered by (known to) this VirtualBox installation and will be
+        accessible through <link to="#getFloppyImage()"/> and
+        <link to="#findFloppyImage()"/> methods. Remembered images are also
+        returned as part of the <link to="#floppyImages"/> array and can be
+        mounted to virtual machines. See IMedium for more details.
+
+        See <link to="IMedium::location"/> to get more details about the format
+        of the location string.
+
+        <result name="VBOX_E_FILE_ERROR">
+          Floppy image specified by @a location not accessible.
+        </result>
+        <result name="VBOX_E_INVALID_OBJECT_STATE">
+          Floppy image already exists in the media registry.
+        </result>
+
+        <note>
+          Currently, only raw floppy images are supported by VirtualBox.
+        </note>
+      </desc>
+      <param name="location" type="wstring" dir="in">
+        <desc>
+          Full path to the file that contains a valid floppy image.
+        </desc>
+      </param>
+      <param name="id" type="uuid" dir="in">
+        <desc>
+          UUID to assign to the given image file within this VirtualBox
+          installation. If an empty (null) UUID is specified, the system will
+          randomly generate a new UUID.
+        </desc>
+      </param>
+      <param name="image" type="IFloppyImage2" dir="return">
+        <desc>Opened floppy image object.</desc>
+      </param>
+    </method>
+
+    <method name="getFloppyImage">
+      <desc>
+        Returns a floppy image with the given UUID.
+
+        The image with the given UUID must be known to this VirtualBox
+        installation, i.e. it must be previously opened by <link
+        to="#openFloppyImage()"/>, or mounted to some known virtual machine.
+
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No matching floppy image found in the media registry.
+        </result>
+
+      </desc>
+      <param name="id" type="uuid" dir="in">
+        <desc>UUID of the image to look for.</desc>
+      </param>
+      <param name="image" type="IFloppyImage2" dir="return">
+        <desc>Found floppy image object.</desc>
+      </param>
+    </method>
+
+    <method name="findFloppyImage">
+      <desc>
+        Returns a floppy image with the given image location.
+
+        The image with the given UUID must be known to this VirtualBox
+        installation, i.e. it must be previously opened by <link
+        to="#openFloppyImage()"/>, or mounted to some known virtual machine.
+
+        The search is done by comparing the value of the @a location argument to
+        the <link to="IMedium::location"/> attribute of each known floppy image.
 
         The requested location can be a path relative to the
@@ -1843,83 +1959,12 @@
         that on case sensitive file systems, a case sensitive comparison is
         performed, otherwise the case of symbols in the file path is ignored.
-      </desc>
-      <param name="location" type="wstring" dir="in">
-        <desc>CD/DVD image file path to look for.</desc>
-      </param>
-      <param name="image" type="IDVDImage2" dir="return">
-        <desc>Found CD/DVD image object.</desc>
-      </param>
-    </method>
-
-    <method name="openFloppyImage">
-      <desc>
-        Opens a floppy image contained in the specified file of the supported
-        format and assigns it the given UUID.
-
-        After the image is successfully opened by this method, it gets
-        remembered by (known to) this VirtualBox installation and will be
-        accessible through <link to="#getFloppyImage()"/> and
-        <link to="#findFloppyImage()"/> methods. Remembered images are also
-        returned as part of the <link to="#floppyImages"/> array and can be
-        mounted to virtual machines. See IMedium for more details.
-
-        See <link to="IMedium::location"/> to get more details about the format
-        of the location string.
-
-        <note>
-          Currently, only raw floppy images are supported by VirtualBox.
-        </note>
-      </desc>
-      <param name="location" type="wstring" dir="in">
-        <desc>
-          Full path to the file that contains a valid floppy image.
-        </desc>
-      </param>
-      <param name="id" type="uuid" dir="in">
-        <desc>
-          UUID to assign to the given image file within this VirtualBox
-          installation. If an empty (null) UUID is specified, the system will
-          randomly generate a new UUID.
-        </desc>
-      </param>
-      <param name="image" type="IFloppyImage2" dir="return">
-        <desc>Opened floppy image object.</desc>
-      </param>
-    </method>
-
-    <method name="getFloppyImage">
-      <desc>
-        Returns a floppy image with the given UUID.
-
-        The image with the given UUID must be known to this VirtualBox
-        installation, i.e. it must be previously opened by <link
-        to="#openFloppyImage()"/>, or mounted to some known virtual machine.
-      </desc>
-      <param name="id" type="uuid" dir="in">
-        <desc>UUID of the image to look for.</desc>
-      </param>
-      <param name="image" type="IFloppyImage2" dir="return">
-        <desc>Found floppy image object.</desc>
-      </param>
-    </method>
-
-    <method name="findFloppyImage">
-      <desc>
-        Returns a floppy image with the given image location.
-
-        The image with the given UUID must be known to this VirtualBox
-        installation, i.e. it must be previously opened by <link
-        to="#openFloppyImage()"/>, or mounted to some known virtual machine.
-
-        The search is done by comparing the value of the @a location argument to
-        the <link to="IMedium::location"/> attribute of each known floppy image.
-
-        The requested location can be a path relative to the
-        <link to="IVirtualBox::homeFolder">VirtualBox home folder</link>. If
-        only a file name without any path is given, the
-        <link to="ISystemProperties::defaultHardDiskFolder"> default hard disk
-        folder</link> will be prepended to the file name before searching. Note
-        that on case sensitive file systems, a case sensitive comparison is
-        performed, otherwise the case of symbols in the file path is ignored.
+
+        <result name="VBOX_E_FILE_ERROR">
+          Invalid image file location.
+        </result>
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No matching floppy image found in the media registry.
+        </result>
+
       </desc>
       <param name="location" type="wstring" dir="in">
@@ -1945,4 +1990,9 @@
         <link to="IGuestOSType::id"/> attribute which contains an identifier of
         the guest OS this object describes.
+
+        <result name="E_INVALIDARG">
+          @a id is not a valid Guest OS type.
+        </result>
+
       </desc>
       <param name="id" type="wstring" dir="in">
@@ -1960,4 +2010,8 @@
         folders and starts sharing it. Refer to the description of
         <link to="ISharedFolder"/> to read more about logical names.
+        <note>
+          In the current implementation, this operation is not
+          implemented.
+        </note>
       </desc>
       <param name="name" type="wstring" dir="in">
@@ -1977,4 +2031,8 @@
         created by <link to="#createSharedFolder"/> from the collection of
         shared folders and stops sharing it.
+        <note>
+          In the current implementation, this operation is not
+          implemented.
+        </note>
       </desc>
       <param name="name" type="wstring" dir="in">
@@ -1992,4 +2050,9 @@
         nextKey (if there is any). @a nextValue is an optional parameter and
         if supplied, the next key's value is returned in it.
+
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          Extra data @a key not found.
+        </result>
+
       </desc>
       <param name="key" type="wstring" dir="in">
@@ -2010,4 +2073,12 @@
         If the requested data @a key does not exist, this function will
         succeed and return @c NULL in the @a value argument.
+
+        <result name="VBOX_E_FILE_ERROR">
+          Settings file not accessible.
+        </result>
+        <result name="VBOX_E_XML_ERROR">
+          Could not parse the settings file.
+        </result>
+
       </desc>
       <param name="key" type="wstring" dir="in">
@@ -2039,4 +2110,15 @@
           change.
         </note>
+
+        <result name="VBOX_E_FILE_ERROR">
+          Settings file not accessible.
+        </result>
+        <result name="VBOX_E_XML_ERROR">
+          Could not parse the settings file.
+        </result>
+        <result name="E_ACCESSDENIED">
+          Modification request refused.
+        </result>
+
       </desc>
       <param name="key" type="wstring" dir="in">
@@ -2099,4 +2181,18 @@
         <li>Close the session by calling <link to="ISession::close()"/>.</li>
         </ol>
+
+        <result name="E_UNEXPECTED">
+          Virtual machine not registered.
+        </result>
+        <result name="E_ACCESSDENIED">
+          Process not started by OpenRemoteSession.
+        </result>
+        <result name="VBOX_E_INVALID_OBJECT_STATE">
+          Session already open or being opened.
+        </result>
+        <result name="VBOX_E_VM_ERROR">
+          Failed to assign machine to session.
+        </result>
+
       </desc>
       <param name="session" type="ISession" dir="in">
@@ -2127,5 +2223,6 @@
         that such prevent conflicting changes, one cannot open a remote session
         for a VM that already has another open session (direct or remote), or
-        is currently in the process of opening one (see <link to="IMachine::sessionState"/>).
+        is currently in the process of opening one (see <link
+          to="IMachine::sessionState"/>).
 
         While the remote session still provides some level of control over the
@@ -2174,4 +2271,24 @@
 
         <see>openExistingSession</see>
+
+        <result name="E_UNEXPECTED">
+          Virtual machine not registered.
+        </result>
+        <result name="E_INVALIDARG">
+          Invalid session type @a type.
+        </result>
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No machine matching @a machineId found.
+        </result>
+        <result name="VBOX_E_INVALID_OBJECT_STATE">
+          Session already open or being opened.
+        </result>
+        <result name="VBOX_E_IPRT_ERROR">
+          Launching process for machine failed.
+        </result>
+        <result name="VBOX_E_VM_ERROR">
+          Failed to assign machine to session.
+        </result>
+
       </desc>
       <param name="session" type="ISession" dir="in">
@@ -2217,4 +2334,21 @@
           doesn't have an open direct session.
         </note>
+
+        <result name="E_UNEXPECTED">
+          Virtual machine not registered.
+        </result>
+        <result name="VBOX_E_OBJECT_NOT_FOUND">
+          No machine matching @a machineId found.
+        </result>
+        <result name="VBOX_E_INVALID_OBJECT_STATE">
+          Session already open or being opened.
+        </result>
+        <result name="VBOX_E_INVALID_SESSION_STATE">
+          Direct session state not Open.
+        </result>
+        <result name="VBOX_E_VM_ERROR">
+          Failed to get console object from direct session or assign
+          machine to session.
+        </result>
 
         <see>openRemoteSession</see>
@@ -2241,4 +2375,10 @@
         callback object will be called by VirtualBox when an appropriate
         event occurs.
+
+        <result name="E_INVALIDARG">
+          Registering a @c NULL @a callback is pretty pointless, ain't it?
+          <!-- See if someone is actually reading this and objects :-) -->
+        </result>
+
       </desc>
       <param name="callback" type="IVirtualBoxCallback" dir="in">
@@ -2250,4 +2390,9 @@
       <desc>
         Unregisters the previously registered global VirtualBox callback.
+
+        <result name="E_INVALIDARG">
+          Specified @a callback not registered.
+        </result>
+
       </desc>
       <param name="callback" type="IVirtualBoxCallback" dir="in">
@@ -2324,4 +2469,8 @@
         </table>
 
+        <note>
+          This function is not implemented in the current version of the
+          product.
+        </note>
       </desc>
       <param name="what" type="wstring" dir="in">
@@ -2355,4 +2504,12 @@
         Normally, the global settings file is implicitly saved when a global
         setting is changed.
+
+        <result name="VBOX_E_FILE_ERROR">
+          Settings file not accessible.
+        </result>
+        <result name="VBOX_E_XML_ERROR">
+          Could not parse the settings file.
+        </result>
+
       </desc>
     </method>
@@ -2398,4 +2555,15 @@
 
         <see>settingsFileVersion</see>
+
+        <result name="VBOX_E_FILE_ERROR">
+          Settings file not accessible.
+        </result>
+        <result name="VBOX_E_XML_ERROR">
+          Could not parse the settings file.
+        </result>
+        <result name="VBOX_E_IPRT_ERROR">
+          Could not copy the settings file.
+        </result>
+
       </desc>
       <param name="bakFileName" type="wstring" dir="return">
