VirtualBox

Changeset 14573 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 25, 2008 1:40:58 PM (16 years ago)
Author:
vboxsync
Message:

Main: Prototyped IHardDisk2::getProperty()/setProperty().

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HardDisk2Impl.cpp

    r14294 r14573  
    920920// IHardDisk2 methods
    921921////////////////////////////////////////////////////////////////////////////////
     922
     923STDMETHODIMP HardDisk2::GetProperty (INPTR BSTR aName, BSTR *aValue)
     924{
     925//  CheckComArgStrNotEmptyOrNull (aName);
     926//  CheckComArgOutPointerValid (aValue);
     927//
     928//  AutoCaller autoCaller (this);
     929//  CheckComRCReturnRC (autoCaller.rc());
     930//
     931//  AutoReadLock alock (this);
     932
     933    return E_NOTIMPL;
     934}
     935
     936STDMETHODIMP HardDisk2::SetProperty (INPTR BSTR aName, INPTR BSTR aValue)
     937{
     938//  CheckComArgStrNotEmptyOrNull (aName);
     939//
     940//  AutoWriteLock alock (this);
     941
     942    return E_NOTIMPL;
     943}
     944
     945STDMETHODIMP HardDisk2::GetProperties (INPTR BSTR aNames,
     946                                       ComSafeArrayOut (BSTR, aReturnNames),
     947                                       ComSafeArrayOut (BSTR, aReturnValues))
     948{
     949//  ComSafeArrayOutIsNull
     950
     951    return E_NOTIMPL;
     952}
    922953
    923954STDMETHODIMP HardDisk2::CreateDynamicStorage (ULONG64 aLogicalSize,
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14569 r14573  
    6666<idl>
    6767
     68<desc>
     69  Welcome to the <b>VirtualBox Main API documentation</b>. This documentation
     70  describes the so-called <i>VirtualBox Main API</i> which comprises all public
     71  COM interfaces and components provided by the VirtualBox server and by the
     72  VirtualBox client library.
     73
     74  VirtualBox employs a client-server design, meaning that whenever any part of
     75  VirtualBox is running -- be it the Qt GUI, the VBoxManage command-line
     76  interface or any virtual machine --, a dedicated server process named
     77  VBoxSVC runs in the background. This allows multiple processes working with
     78  VirtualBox to cooperate without conflicts. These processes communicate to each
     79  other using inter-process communication facilities provided by the COM
     80  implementation of the host computer.
     81
     82  On Windows platforms, the VirtualBox Main API uses Microsoft COM, a native COM
     83  implementation. On all other platforms, Mozilla XPCOM, an open-source COM
     84  implementation, is used.
     85
     86  All the parts that a typical VirtualBox user interacts with (the Qt GUI,
     87  the VBoxManage command-line interface and the VBoxVRDP server) are technically
     88  front-ends to the Main API and only use the interfaces that are documented
     89  in this Main API documentation. This ensures that, with any given release
     90  version of VirtualBox, all capabilities of the product that could be useful
     91  to an external client program are always exposed by way of this API.
     92
     93  The VirtualBox Main API (also called the <i>VirtualBox COM library</i>)
     94  contains two public component classes:
     95  <tt>%VirtualBox.VirtualBox</tt> and <tt>%VirtualBox.Session</tt>, which
     96  implement IVirtualBox and ISession interfaces respectively. These two classes
     97  are of supreme importance and will be needed in order for any front-end
     98  program to do anything useful. It is recommended to read the documentation of
     99  the mentioned interfaces first.
     100
     101  The <tt>%VirtualBox.VirtualBox</tt> class is a singleton. This means that
     102  there can be only one object of this class on the local machine at any given
     103  time. This object is a parent of many other objects ih the VirtualBox COM
     104  library and lives in the VBoxSVC process. In fact, when you create an instance
     105  of the <tt>VirtualBox.VirtualBox</tt>, the COM subsystem checks if the VBoxSVC
     106  process is already running, starts it if not, and returns you a reference to
     107  the<tt>VirtualBox</tt> object created in this process. When the last reference
     108  to this object is released, the VBoxSVC process ends (with a 5 second delay to
     109  protect from too frequent restarts).
     110
     111  The <tt>%VirtualBox.Session</tt> class is a regular component. You can create
     112  as many <tt>Session</tt> objects as you need but all of them will live in a
     113  process which issues the object instantiation call. <tt>Session</tt> objects
     114  represent virtual machine sessions which are used to configure virtual
     115  machines and control their execution.
     116</desc>
     117
    68118<if target="midl">
    69119  <cpp line="enum {"/>
     
    155205  -->
    156206
     207  <descGroup id="VirtualBox_COM_result_codes" title="VirtualBox COM result codes">
     208    <desc>
     209      This section describes all VirtualBox-specific COM result codes that may
     210      be returned by methods of VirtualBox COM interfaces in addition to
     211      standard COM result codes.
     212
     213      Note that along with the result code, every VirtualBox method returns
     214      extended error information through the IVirtualBoxErrorInfo interface on
     215      failure. This interface is a preferred way to present the error to the end
     216      user because it contains a human readable description of the error. Raw
     217      result codes, both standard and described in this section, are intended to
     218      be used by programs to analyze the reason of a failure and select an
     219      appropriate course of action without involving the end user (for example,
     220      retry the operation later or make a different call).
     221
     222      The standard COM result codes that may originate from our methods include:
     223
     224      <table>
     225      <tr><td>E_INVALIDARG</td>
     226      <td>
     227        Returned when the value of the method's argument is not within the range
     228        of valid values. This should not be confused with situations when the
     229        value is within the range but simply doesn't suit the current object
     230        state and there is a possibility that it will be accepted later (in such
     231        cases VirtualBox-specific codes are returned, for example,
     232        <link to="VBOX_E_OBJECT_NOT_FOUND"/>).
     233      </td>
     234      </tr>
     235      <tr><td>E_POINTER</td>
     236      <td>
     237        Returned if a memory pointer for the output argument is invalid (for
     238        example, <tt>NULL</tt>). Note that when pointers representing input
     239        arguments (such as strings) are invalid, E_INVALIDARG is returned.
     240      </td>
     241      </tr>
     242      <tr><td>E_ACCESSDENIED</td>
     243      <td>
     244        Returned when the called object is not ready. Since the lifetime of a
     245        public COM object cannot be fully controlled by the implementation,
     246        VirtualBox maintains the readiness state for all objects it creates and
     247        returns this code in response to any method call on the object that was
     248        deactivated by VirtualBox and is not functioning any more.
     249      </td>
     250      </tr>
     251      <tr><td>E_OUTOFMEMORY</td>
     252      <td>
     253        Returned when a memory allocation operation fails.
     254      </td>
     255      </tr>
     256      </table>
     257    </desc>
     258  </descGroup>
     259
    157260  <result name="VBOX_E_OBJECT_NOT_FOUND" value="0x80BB0001">
    158261    <desc>
     
    190293    </desc>
    191294  </result>
     295
     296  <descGroup/>
    192297
    193298  <!--
     
    66646769  <interface
    66656770    name="IHardDisk2" extends="IMedium"
    6666     uuid="be30c487-3071-4067-8a03-8fed74a80708"
     6771    uuid="4fece1c1-2a75-43ce-ba82-76d2a89b9d5d"
    66676772    wsmap="managed"
    66686773  >
     
    70637168    <!-- storage methods -->
    70647169
     7170    <method name="getProperty">
     7171      <desc>
     7172        Returns the value of the custom hard disk property with the given name.
     7173
     7174        The list of all properties supported by the given hard disk format can
     7175        be obtained with <link to="IHardDiskFormat::describeProperties()"/>.
     7176
     7177        Note that If <tt>null</tt> returned by this method as @a value, it
     7178        means that the requested property is supported but currently has not
     7179        assigned any value.
     7180
     7181        <result name="VBOX_E_OBJECT_NOT_FOUND">
     7182          Requested property does not exist (not supported by the format).
     7183        </result>
     7184        <result name="E_INVALIDARG">@a name is NULL or empty.</result>
     7185      </desc>
     7186      <param name="name" type="wstring" dir="in">
     7187        <desc>Name of the property to get.</desc>
     7188      </param>
     7189      <param name="value" type="wstring" dir="return">
     7190        <desc>Current property value.</desc>
     7191      </param>
     7192    </method>
     7193
     7194    <method name="setProperty">
     7195      <desc>
     7196        Sets the value of the custom hard disk property with the given name.
     7197
     7198        The list of all properties supported by the given hard disk format can
     7199        be obtained with <link to="IHardDiskFormat::describeProperties()"/>.
     7200
     7201        Note that passing <tt>null</tt> as @a value will reset the value of the
     7202        property to nothing which may also be undertood as deleting the
     7203        property's value. For properties with no values, the format backend will
     7204        use a default value if such a value is defined for the given roperty.
     7205
     7206        <result name="VBOX_E_OBJECT_NOT_FOUND">
     7207          Requested property does not exist (not supported by the format).
     7208        </result>
     7209        <result name="E_INVALIDARG">@a name is NULL or empty.</result>
     7210      </desc>
     7211      <param name="name" type="wstring" dir="in">
     7212        <desc>Name of the property to set.</desc>
     7213      </param>
     7214      <param name="value" type="wstring" dir="in">
     7215        <desc>Property value to set.</desc>
     7216      </param>
     7217    </method>
     7218
     7219    <method name="getProperties">
     7220      <desc>
     7221        Returns values for a group of properties in one call.
     7222
     7223        The names of the properties to get are specified using the @a name
     7224        argument which is a list of comma-separated property names or
     7225        <tt>null</tt> if all properties are to be returned. Note that currently
     7226        the value of this argument is ignored and the method always returns all
     7227        existing properties.
     7228
     7229        The list of all properties supported by the given hard disk format can
     7230        be obtained with <link to="IHardDiskFormat::describeProperties()"/>.
     7231
     7232        The method returns two arrays, the array of property names correspinding
     7233        to the @a names argument and the current values of these properties. Both
     7234        arrays
     7235
     7236        Note that for properties that don't have values assigned to them,
     7237        <tt>null</tt> is returned at the appropriate index in the @a returnValues
     7238        array.
     7239      </desc>
     7240      <param name="names" type="wstring" dir="in">
     7241        <desc>
     7242          Names of properties to get.
     7243        </desc>
     7244      </param>
     7245      <param name="returnNames" type="wstring" safearray="yes" dir="out">
     7246        <desc>Names of returned properties.</desc>
     7247      </param>
     7248      <param name="returnValues" type="wstring" safearray="yes" dir="return">
     7249        <desc>Values of returned properties.</desc>
     7250      </param>
     7251    </method>
     7252
     7253    <!-- storage methods -->
     7254
    70657255    <method name="createDynamicStorage">
    70667256      <desc>
  • trunk/src/VBox/Main/include/HardDisk2Impl.h

    r14272 r14573  
    9797
    9898    // IHardDisk2 methods
     99    STDMETHOD(GetProperty) (INPTR BSTR aName, BSTR *aValue);
     100    STDMETHOD(SetProperty) (INPTR BSTR aName, INPTR BSTR aValue);
     101    STDMETHOD(GetProperties) (INPTR BSTR aNames,
     102                              ComSafeArrayOut (BSTR, aReturnNames),
     103                              ComSafeArrayOut (BSTR, aReturnValues));
    99104    STDMETHOD(CreateDynamicStorage) (ULONG64 aLogicalSize, IProgress **aProgress);
    100105    STDMETHOD(CreateFixedStorage) (ULONG64 aLogicalSize, IProgress **aProgress);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette