VirtualBox

Changeset 20928 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 25, 2009 11:53:37 AM (16 years ago)
Author:
vboxsync
Message:

API/others: Renamed IConsole::discardSavedState to IConsole::forgetSavedState, added parameter. Deleted old IConsole::powerDown, renamed IConsole::powerDownAsync to IConsole::powerDown (as promised for 2.1). Implemented perl sample code for registering a hard disk. Cleaned up constant formatting in the API docs. Updated SDK changelog. Renamed com/errorprint2.h to com/errorprint.h, added a few assertion variants. Eliminated com/errorprint_legacy.h. Adjusted all files using the affected headers and APIs. Renamed tstHeadless2 to tstHeadless.

Location:
trunk/src/VBox/Main
Files:
10 edited
1 moved

Legend:

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

    r20885 r20928  
    77
    88/*
    9  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    13221322}
    13231323
    1324 STDMETHODIMP Console::PowerDown()
    1325 {
    1326     LogFlowThisFuncEnter();
    1327     LogFlowThisFunc (("mMachineState=%d\n", mMachineState));
    1328 
    1329     AutoCaller autoCaller (this);
    1330     CheckComRCReturnRC (autoCaller.rc());
    1331 
    1332     AutoWriteLock alock (this);
    1333 
    1334     if (!Global::IsActive (mMachineState))
    1335     {
    1336         /* extra nice error message for a common case */
    1337         if (mMachineState == MachineState_Saved)
    1338             return setError (VBOX_E_INVALID_VM_STATE,
    1339                 tr ("Cannot power down a saved virtual machine"));
    1340         else if (mMachineState == MachineState_Stopping)
    1341             return setError (VBOX_E_INVALID_VM_STATE,
    1342                 tr ("Virtual machine is being powered down"));
    1343         else
    1344             return setError(VBOX_E_INVALID_VM_STATE,
    1345                 tr ("Invalid machine state: %d (must be Running, Paused "
    1346                     "or Stuck)"),
    1347                 mMachineState);
    1348     }
    1349 
    1350     LogFlowThisFunc (("Sending SHUTDOWN request...\n"));
    1351 
    1352     HRESULT rc = powerDown();
    1353 
    1354     LogFlowThisFunc (("mMachineState=%d, rc=%08X\n", mMachineState, rc));
    1355     LogFlowThisFuncLeave();
    1356     return rc;
    1357 }
    1358 
    1359 STDMETHODIMP Console::PowerDownAsync (IProgress **aProgress)
     1324STDMETHODIMP Console::PowerDown (IProgress **aProgress)
    13601325{
    13611326    if (aProgress == NULL)
     
    18371802}
    18381803
    1839 STDMETHODIMP Console::DiscardSavedState()
     1804STDMETHODIMP Console::ForgetSavedState(BOOL aRemove)
    18401805{
    18411806    AutoCaller autoCaller (this);
     
    18501815            mMachineState);
    18511816
     1817    HRESULT rc = S_OK;
     1818
     1819    rc = mControl->SetRemoveSavedState(aRemove);
     1820    CheckComRCReturnRC (rc);
     1821
    18521822    /*
    18531823     *  Saved -> PoweredOff transition will be detected in the SessionMachine
    18541824     *  and properly handled.
    18551825     */
    1856     setMachineState (MachineState_PoweredOff);
    1857 
    1858     return S_OK;
     1826    rc = setMachineState (MachineState_PoweredOff);
     1827
     1828    return rc;
    18591829}
    18601830
  • trunk/src/VBox/Main/MachineImpl.cpp

    r20852 r20928  
    82408240////////////////////////////////////////////////////////////////////////////////
    82418241
    8242 DEFINE_EMPTY_CTOR_DTOR (SessionMachine)
     8242SessionMachine::SessionMachine()
     8243    : mRemoveSavedState(true)
     8244{}
     8245
     8246SessionMachine::~SessionMachine()
     8247{}
    82438248
    82448249HRESULT SessionMachine::FinalConstruct()
     
    86868691
    86878692/**
     8693 *  @note Locks this object for writing.
     8694 */
     8695STDMETHODIMP SessionMachine::SetRemoveSavedState(BOOL aRemove)
     8696{
     8697    AutoCaller autoCaller (this);
     8698    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     8699
     8700    AutoWriteLock alock (this);
     8701
     8702    mRemoveSavedState = aRemove;
     8703
     8704    return S_OK;
     8705}
     8706
     8707/**
    86888708 *  @note Locks the same as #setMachineState() does.
    86898709 */
     
    1127511295    }
    1127611296
    11277     if (deleteSavedState == true)
    11278     {
    11279         /** @todo remove this API hack, and provide a clean way for
    11280          * detaching a saved state without deleting. */
    11281         Utf8Str val;
    11282         HRESULT rc2 = getExtraData("API/DiscardSavedStateKeepFile", val);
    11283         if (FAILED(rc2) || val != "1")
     11297    if (deleteSavedState)
     11298    {
     11299        if (mRemoveSavedState)
    1128411300        {
    1128511301            Assert (!mSSData->mStateFilePath.isEmpty());
  • trunk/src/VBox/Main/Makefile.kmk

    r20882 r20928  
    55
    66#
    7 # Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7# Copyright (C) 2006-2009 Sun Microsystems, Inc.
    88#
    99# This file is part of VirtualBox Open Source Edition (OSE), as
     
    678678        glue/EventQueue.cpp \
    679679        glue/ErrorInfo.cpp \
    680         glue/errorprint2.cpp \
     680        glue/errorprint.cpp \
    681681        glue/SupportErrorInfo.cpp \
    682682        glue/VirtualBoxErrorInfo.cpp
  • trunk/src/VBox/Main/glue/errorprint.cpp

    r20914 r20928  
    33/** @file
    44 * MS COM / XPCOM Abstraction Layer:
    5  * Error info print helpers. This implements the shared code from the macros from errorprint2.h.
     5 * Error info print helpers. This implements the shared code from the macros from errorprint.h.
    66 */
    77
     
    2424
    2525#include <VBox/com/ErrorInfo.h>
    26 #include <VBox/com/errorprint2.h>
     26#include <VBox/com/errorprint.h>
    2727#include <VBox/log.h>
    2828
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r20897 r20928  
    233233      <td>
    234234        Returned if a memory pointer for the output argument is invalid (for
    235         example, <tt>NULL</tt>). Note that when pointers representing input
     235        example, @c null). Note that when pointers representing input
    236236        arguments (such as strings) are invalid, E_INVALIDARG is returned.
    237237      </td>
     
    494494        needed: for any online VM state, the condition
    495495        <tt>FirstOnline &lt;= state &lt;= LastOnline</tt> must be
    496         <tt>true</tt>. The same relates to transient states for which
     496        @c true. The same relates to transient states for which
    497497        the condition <tt>FirstOnline &lt;= state &lt;= LastOnline</tt> must be
    498         <tt>true</tt>.
     498        @c true.
    499499      </note>
    500500    </desc>
     
    10271027      <desc>
    10281028        Notification when someone tries to change extra data for
    1029         either the given machine or (if null) global extra data.
     1029        either the given machine or (if @c null) global extra data.
    10301030        This gives the chance to veto against changes.
    10311031      </desc>
     
    10331033        <desc>
    10341034          ID of the machine this event relates to
    1035           (null ID for global extra data change requests).
     1035          (@c null ID for global extra data change requests).
    10361036        </desc>
    10371037      </param>
     
    11181118      <param name="registered" type="boolean" dir="in">
    11191119        <desc>
    1120           If true, the media was registered, otherwise it was
     1120          If @c true, the media was registered, otherwise it was
    11211121          unregistered.
    11221122        </desc>
     
    11341134      <param name="registered" type="boolean" dir="in">
    11351135        <desc>
    1136           If true, the machine was registered, otherwise it was
     1136          If @c true, the machine was registered, otherwise it was
    11371137          unregistered.
    11381138        </desc>
     
    11831183      <param name="snapshotId" type="wstring" dir="in">
    11841184        <desc>
    1185           ID of the discarded snapshot. <tt>null</tt> means the
    1186           current machine state has been discarded (restored from
    1187           the current snapshot).
     1185          ID of the discarded snapshot. @c null means the current machine
     1186          state has been discarded (restored from the current snapshot).
    11881187        </desc>
    11891188      </param>
     
    13441343  <interface
    13451344    name="IVirtualBox" extends="$dispatched"
    1346     uuid="54bf05ec-3fa9-4735-b92e-76e7c6c7e2be"
     1345    uuid="3f4ab53a-199b-4526-a91a-93ff62e456b8"
    13471346    wsmap="managed"
    13481347  >
     
    14191418          x.y-platform
    14201419        </pre>
    1421         where <tt>x</tt> and <tt>y</tt> are the major and the minor format
    1422         versions, and <tt>platform</tt> is the platform identifier.
     1420        where @c x and @c y are the major and the minor format
     1421        versions, and @c platform is the platform identifier.
    14231422
    14241423        The current version usually matches the value of the
     
    14551454          x.y-platform
    14561455        </pre>
    1457         where <tt>x</tt> and <tt>y</tt> are the major and the minor format
    1458         versions, and <tt>platform</tt> is the platform identifier.
     1456        where @c x and @c y are the major and the minor format
     1457        versions, and @c platform is the platform identifier.
    14591458
    14601459        VirtualBox uses this version of the format when saving settings files
     
    15821581        directory</link>.
    15831582
    1584         If @a baseFolder is a null or empty string (which is recommended), the
     1583        If @a baseFolder is a @c null or empty string (which is recommended), the
    15851584        <link to="ISystemProperties::defaultMachineFolder">default machine
    15861585        settings folder</link> will be used as a base folder for the created
     
    15971596        Optionally, you may specify an UUID of to assign to the created machine.
    15981597        However, this is not recommended and you should normally pass an empty
    1599         (null) UUID to this method so that a new UUID will be automatically
     1598        (@c null) UUID to this method so that a new UUID will be automatically
    16001599        generated for every created machine. You can use UUID
    1601         00000000-0000-0000-0000-000000000000 as null value.
     1600        00000000-0000-0000-0000-000000000000 as @c null value.
    16021601
    16031602        <note>
     
    16141613        </result>
    16151614        <result name="E_INVALIDARG">
    1616           @a name is empty or null.
     1615          @a name is empty or @c null.
    16171616        </result>
    16181617      </desc>
     
    16741673        </result>
    16751674        <result name="E_INVALIDARG">
    1676           @a name or @a settingsFile is empty or null.
     1675          @a name or @a settingsFile is empty or @c null.
    16771676        </result>
    16781677      </desc>
     
    17221721      <note>
    17231722        <link to="IMachine::settingsModified"/> will return
    1724         false for the created machine, until any of machine settings
     1723        @c false for the created machine, until any of machine settings
    17251724        are changed.
    17261725      </note>
     
    18671866        installation can be obtained using
    18681867        <link to="ISystemProperties::hardDiskFormats"/>. If the @a format
    1869         attribute is empty or <tt>null</tt> then the default storage format
     1868        attribute is empty or @c null then the default storage format
    18701869        specified by <link to="ISystemProperties::defaultHardDiskFormat"/> will
    18711870        be used for creating a storage unit of the hard disk.
     
    18831882        </result>
    18841883        <result name="E_INVALIDARG">
    1885           @a format is a null or empty string.
     1884          @a format is a @c null or empty string.
    18861885        </result>
    18871886      </desc>
     
    20792078        <desc>
    20802079          UUID to assign to the given image within this VirtualBox installation.
    2081           If an empty (null) UUID is specified, the system will randomly
     2080          If an empty (@c null) UUID is specified, the system will randomly
    20822081          generate a new UUID.
    20832082        </desc>
     
    21792178        <desc>
    21802179          UUID to assign to the given image file within this VirtualBox
    2181           installation. If an empty (null) UUID is specified, the system will
     2180          installation. If an empty (@c null) UUID is specified, the system will
    21822181          randomly generate a new UUID.
    21832182        </desc>
     
    23132312        Returns the global extra data key name following the supplied key.
    23142313
    2315         An error is returned if the supplied @a key does not exist. @c NULL is
     2314        An error is returned if the supplied @a key does not exist. @c null is
    23162315        returned in @a nextKey if the supplied key is the last key. When
    2317         supplying @c NULL or an empty string for the @a key, the first key item
     2316        supplying @c null or an empty string for the @a key, the first key item
    23182317        is returned in @a nextKey (if there is any). @a nextValue is an optional
    23192318        parameter and if supplied, the next key's value is returned in it.
     
    23402339
    23412340        If the requested data @a key does not exist, this function will
    2342         succeed and return @c NULL in the @a value argument.
     2341        succeed and return @c null in the @a value argument.
    23432342
    23442343        <result name="VBOX_E_FILE_ERROR">
     
    23622361        Sets associated global extra data.
    23632362
    2364         If you pass @c NULL as a key @a value, the given @a key will be
     2363        If you pass @c null as a key @a value, the given @a key will be
    23652364        deleted.
    23662365
     
    25212520        argument) are:
    25222521        <ul>
    2523           <li><tt>gui</tt>: VirtualBox Qt GUI session</li>
    2524           <li><tt>vrdp</tt>: VirtualBox VRDP Server session</li>
    2525           <li><tt>sdl</tt>: VirtualBox SDL GUI session</li>
     2522          <li><tt>"gui"</tt>: VirtualBox Qt GUI session</li>
     2523          <li><tt>"vrdp"</tt>: VirtualBox VRDP Server session</li>
     2524          <li><tt>"sdl"</tt>: VirtualBox SDL GUI session</li>
    25262525        </ul>
    25272526
     
    26492648
    26502649        <result name="E_INVALIDARG">
    2651           A @c NULL callback cannot be registered.
     2650          A @c null callback cannot be registered.
    26522651        </result>
    26532652
     
    28072806
    28082807        If the given backup file already exists, this method will try to add the
    2809         <tt>.N</tt> suffix to the backup file name (where <tt>N</tt> counts from
     2808        <tt>.N</tt> suffix to the backup file name (where @c N counts from
    28102809        0 to 9) and copy it again until it succeeds. If all suffixes are
    28112810        occupied, or if any other copy error occurs, this method will return a
     
    36643663        the configuration remains unchanged. Please see the documentation for getDescription()
    36653664        for valid configuration values for the individual array item types. If the
    3666         corresponding item in the aEnabled array is false, the configuration value is ignored.
     3665        corresponding item in the aEnabled array is @c false, the configuration value is ignored.
    36673666      </desc>
    36683667
     
    37103709  <interface
    37113710     name="IInternalMachineControl" extends="$unknown"
    3712      uuid="5595cae1-6b18-42c1-b416-bc7493a87618"
     3711     uuid="ce8087d7-de92-4bbb-8140-a22fb07f37ba"
    37133712     internal="yes"
    37143713     wsmap="suppress"
    37153714     >
     3715    <method name="setRemoveSavedState">
     3716      <desc>
     3717        Updates the flag whether saved state is removed on a machine state
     3718        change from Saved to PowerOff.
     3719      </desc>
     3720      <param name="aRemove" type="boolean" dir="in"/>
     3721    </method>
     3722
    37163723    <method name="updateState">
    37173724      <desc>
     
    37583765    <method name="detachUSBDevice">
    37593766      <desc>
    3760         Notification that a VM is going to detach (done = false) or has
    3761         already detached (done = true) the given USB device.
    3762         When the done = true request is completed, the VM process will
     3767        Notification that a VM is going to detach (@a done = @c false) or has
     3768        already detached (@a done = @c true) the given USB device.
     3769        When the @a done = @c true request is completed, the VM process will
    37633770        get a <link to="IInternalSessionControl::onUSBDeviceDetach"/>
    37643771        notification.
    37653772        <note>
    3766           In the done = true case, the server must run its own filters
     3773          In the @a done = @c true case, the server must run its own filters
    37673774          and filters of all VMs but this one on the detached device
    37683775          as if it were just attached to the host computer.
     
    37863793        Notification that a VM that is being powered down. The done
    37873794        parameter indicates whether which stage of the power down
    3788         we're at. When done = false the VM is announcing its
    3789         intentions, while when done = true the VM is reporting
     3795        we're at. When @a done = @c false the VM is announcing its
     3796        intentions, while when @a done = @c true the VM is reporting
    37903797        what it has done.
    37913798        <note>
    3792           In the done = true case, the server must run its own filters
     3799          In the @a done = @c true case, the server must run its own filters
    37933800          and filters of all VMs but this one on all detach devices as
    37943801          if they were just attached to the host computer.
     
    38493856
    38503857      <param name="success" type="boolean" dir="in">
    3851         <desc><tt>true</tt> to indicate success and <tt>false</tt>
    3852           otherwise.
     3858        <desc>@c true to indicate success and @c false otherwise.
    38533859        </desc>
    38543860      </param>
     
    39153921
    39163922      <param name="success" type="boolean" dir="in">
    3917         <desc><tt>true</tt> to indicate success and <tt>false</tt> otherwise</desc>
     3923        <desc>@c true to indicate success and @c false otherwise</desc>
    39183924      </param>
    39193925    </method>
     
    41974203        </ul>
    41984204
    4199         Otherwise, the value of this property is always <tt>true</tt>.
     4205        Otherwise, the value of this property is always @c true.
    42004206
    42014207        Every time this property is read, the accessibility state of
    4202         this machine is re-evaluated. If the returned value is |false|,
     4208        this machine is re-evaluated. If the returned value is @c false,
    42034209        the <link to="#accessError"/> property may be used to get the
    42044210        detailed error information describing the reason of
     
    42264232        <note>
    42274233          In the current implementation, once this property returns
    4228           <tt>true</tt>, the machine will never become inaccessible
     4234          @c true, the machine will never become inaccessible
    42294235          later, even if its settings file cannot be successfully
    42304236          read/written any more (at least, until the VirtualBox
     
    42414247
    42424248        Reading this property is only valid after the last call to
    4243         <link to="#accessible"/> returned <tt>false</tt> (i.e. the
    4244         machine is currently unaccessible). Otherwise, a null
     4249        <link to="#accessible"/> returned @c false (i.e. the
     4250        machine is currently unaccessible). Otherwise, a @c null
    42454251        IVirtualBoxErrorInfo object will be returned.
    42464252      </desc>
     
    44164422
    44174423        <note>
    4418           Setting this property to <tt>null</tt> will restore the
     4424          Setting this property to @c null will restore the
    44194425          initial value.
    44204426        </note>
     
    44834489          x.y-platform
    44844490        </pre>
    4485         where <tt>x</tt> and <tt>y</tt> are the major and the minor format
    4486         versions, and <tt>platform</tt> is the platform identifier.
     4491        where @c x and @c y are the major and the minor format
     4492        versions, and @c platform is the platform identifier.
    44874493
    44884494        The current version usually matches the value of the
     
    45264532        <note>
    45274533          For newly created unregistered machines, the value of this
    4528           property is always TRUE until <link to="#saveSettings"/>
     4534          property is always @c true until <link to="#saveSettings"/>
    45294535          is called (no matter if any machine settings have been
    45304536          changed after the creation or not). For opened machines
    4531           the value is set to FALSE (and then follows to normal rules).
     4537          the value is set to @c false (and then follows to normal rules).
    45324538        </note>
    45334539      </desc>
     
    45794585        the machine when it is in the <link to="MachineState_Saved"/> state.
    45804586        <note>
    4581           When the machine is not in the Saved state, this attribute
    4582           <tt>null</tt>.
     4587          When the machine is not in the Saved state, this attribute is
     4588          @c null.
    45834589        </note>
    45844590      </desc>
     
    45994605        Current snapshot of this machine.
    46004606        <note>
    4601           A <tt>null</tt> object is returned if the machine doesn't
     4607          A @c null object is returned if the machine doesn't
    46024608          have snapshots.
    46034609        </note>
     
    46154621    <attribute name="currentStateModified" type="boolean" readonly="yes">
    46164622      <desc>
    4617         Returns <tt>true</tt> if the current state of the machine is not
     4623        Returns @c true if the current state of the machine is not
    46184624        identical to the state stored in the current snapshot.
    46194625
     
    46264632          <li><link to="IConsole::takeSnapshot"/> (issued on a
    46274633            powered off or saved machine, for which
    4628             <link to="#settingsModified"/> returns <tt>false</tt>)
     4634            <link to="#settingsModified"/> returns @c false)
    46294635          </li>
    46304636          <li><link to="IMachine::setCurrentSnapshot"/>
     
    46434649        <note>
    46444650          For machines that don't have snapshots, this property is
    4645           always <tt>false</tt>.
     4651          always @c false.
    46464652        </note>
    46474653      </desc>
     
    46954701      <param name="position" type="unsigned long" dir="in">
    46964702        <desc>
    4697           Position in the boot order (<tt>1</tt> to the total number of
     4703          Position in the boot order (@c 1 to the total number of
    46984704          devices the machine can boot from, as returned by
    46994705          <link to="ISystemProperties::maxBootPosition"/>).
     
    47294735      <param name="position" type="unsigned long" dir="in">
    47304736        <desc>
    4731           Position in the boot order (<tt>1</tt> to the total number of
     4737          Position in the boot order (@c 1 to the total number of
    47324738          devices the machine can boot from, as returned by
    47334739          <link to="ISystemProperties::maxBootPosition"/>).
     
    50075013        supplied key.
    50085014
    5009         An error is returned if the supplied @a key does not exist. @c NULL is
     5015        An error is returned if the supplied @a key does not exist. @c null is
    50105016        returned in @a nextKey if the supplied key is the last key. When
    5011         supplying @c NULL for the @a key, the first key item is returned in
     5017        supplying @c null for the @a key, the first key item is returned in
    50125018        @a nextKey (if there is any). @a nextValue is an optional parameter and
    50135019        if supplied, the next key's value is returned in it.
     
    50345040
    50355041        If the requested data @a key does not exist, this function will
    5036         succeed and return @c NULL in the @a value argument.
     5042        succeed and return @c null in the @a value argument.
    50375043
    50385044        <result name="VBOX_E_FILE_ERROR">
     
    50565062        Sets associated machine-specific extra data.
    50575063
    5058         If you pass @c NULL as a key @a value, the given @a key will be
     5064        If you pass @c null as a key @a value, the given @a key will be
    50595065        deleted.
    50605066
     
    51495155
    51505156        If the given backup file already exists, this method will try to add the
    5151         <tt>.N</tt> suffix to the backup file name (where <tt>N</tt> counts from
     5157        <tt>.N</tt> suffix to the backup file name (where @c N counts from
    51525158        0 to 9) and copy it again until it succeeds. If all suffixes are
    51535159        occupied, or if any other copy error occurs, this method will return a
     
    52155221        to succeed.
    52165222        <note>
    5217           <link to="#settingsModified"/> will return TRUE after this
     5223          <link to="#settingsModified"/> will return @c true after this
    52185224          method successfully returns.
    52195225        </note>
     
    52585264      <desc>
    52595265        Returns a snapshot of this machine with the given UUID.
    5260         A <tt>null</tt> UUID can be used to obtain the first snapshot
     5266        A @c null UUID can be used to obtain the first snapshot
    52615267        taken on this machine. This is useful if you want to traverse
    52625268        the whole tree of snapshots starting from the root.
     
    53675373      <param name="canShow" type="boolean" dir="return">
    53685374        <desc>
    5369           @c true if the console window can be shown and @c
    5370           false otherwise.
     5375          @c true if the console window can be shown and @c false otherwise.
    53715376        </desc>
    53725377      </param>
     
    55645569        <desc>
    55655570          The patterns to match the properties against, separated by '|'
    5566           characters.  If this is empty or NULL, all properties will match.
     5571          characters.  If this is empty or @c null, all properties will match.
    55675572        </desc>
    55685573      </param>
     
    58295834      <param name="attached" type="boolean" dir="in">
    58305835        <desc>
    5831           <tt>true</tt> if the device was attached
    5832           and <tt>false</tt> otherwise.
     5836          @c true if the device was attached and @c false otherwise.
    58335837        </desc>
    58345838      </param>
    58355839      <param name="error" type="IVirtualBoxErrorInfo" dir="in">
    58365840        <desc>
    5837           <tt>null</tt> on success or an error message object on
    5838           failure.
     5841          @c null on success or an error message object on failure.
    58395842        </desc>
    58405843      </param>
     
    58725875
    58735876        <b>Fatal</b> errors are indicated by the @a fatal parameter set
    5874         to <tt>true</tt>. In case of fatal errors, the virtual machine
     5877        to @c true. In case of fatal errors, the virtual machine
    58755878        execution is always paused before calling this notification, and
    58765879        the notification handler is supposed either to immediately save
     
    58805883
    58815884        <b>Non-fatal</b> errors and warnings are indicated by the
    5882         @a fatal parameter set to <tt>false</tt>. If the virtual machine
     5885        @a fatal parameter set to @c false. If the virtual machine
    58835886        is in the Paused state by the time the error notification is
    58845887        received, it means that the user can <i>try to resume</i> the machine
     
    59535956      <param name="canShow" type="boolean" dir="return">
    59545957        <desc>
    5955           @c true if the console window can be shown and @c
    5956           false otherwise.
     5958          @c true if the console window can be shown and @c false otherwise.
    59575959        </desc>
    59585960      </param>
     
    61096111  <interface
    61106112     name="IConsole" extends="$unknown"
    6111      uuid="a7f17a42-5b64-488d-977b-4b2c639ada27"
     6113     uuid="0a51994b-cbc6-4686-94eb-d4e4023280e2"
    61126114     wsmap="managed"
    61136115     >
     
    62976299    <method name="powerDown">
    62986300      <desc>
    6299         Stops the virtual machine execution.
    6300         After this operation completes, the machine will go to the
    6301         PoweredOff state.
    6302 
    6303         @deprecated This method will be removed in VirtualBox 2.1 where the
    6304         powerDownAsync() method will take its name. Do not use this method in
    6305         the code.
    6306         <result name="VBOX_E_INVALID_VM_STATE">
    6307           Virtual machine must be Running, Paused or Stuck to be powered down.
    6308         </result>
    6309         <result name="VBOX_E_VM_ERROR">
    6310           Unable to power off or destroy virtual machine.
    6311         </result>
    6312       </desc>
    6313     </method>
    6314 
    6315     <method name="powerDownAsync">
    6316       <desc>
    63176301        Initiates the power down procedure to stop the virtual machine
    63186302        execution.
     
    63216305        IProgress object. After the operation is complete, the machine will go
    63226306        to the PoweredOff state.
    6323 
    6324         @warning This method will be renamed to "powerDown" in VirtualBox 2.1
    6325         where the original powerDown() method will be removed. You will need to
    6326         rename "powerDownAsync" to "powerDown" in your sources to make them
    6327         build with version 2.1.
    63286307        <result name="VBOX_E_INVALID_VM_STATE">
    63296308          Virtual machine must be Running, Paused or Stuck to be powered down.
     
    64016380    <method name="getGuestEnteredACPIMode">
    64026381      <desc>Checks if the guest entered the ACPI mode G0 (working) or
    6403         G1 (sleeping). If this method returns false, the guest will
     6382        G1 (sleeping). If this method returns @c false, the guest will
    64046383        most likely not respond to external ACPI events.
    64056384        <result name="VBOX_E_INVALID_VM_STATE">
     
    64836462    </method>
    64846463
    6485     <method name="discardSavedState">
    6486       <desc>
    6487         Discards (deletes) the saved state of the virtual machine
    6488         previously created by <link to="#saveState"/>. Next time the
    6489         machine is powered up, a clean boot will occur.
     6464    <method name="forgetSavedState">
     6465      <desc>
     6466        Forgets the saved state of the virtual machine previously created
     6467        by <link to="#saveState"/>. Next time the machine is powered up, a
     6468        clean boot will occur. If @a remove is @c true the saved state file
     6469        is deleted.
    64906470        <note>
    64916471          This operation is equivalent to resetting or powering off
     
    64966476        </result>
    64976477      </desc>
     6478      <param name="remove" type="boolean" dir="in">
     6479        <desc>If @c true remove the saved state file.</desc>
     6480      </param>
    64986481    </method>
    64996482
     
    67086691        children at all (i.e. the first snapshot is the only snapshot of
    67096692        the machine), both the current and the first snapshot of the
    6710         machine will be set to null. In all other cases, the first
     6693        machine will be set to @c null. In all other cases, the first
    67116694        snapshot cannot be discarded.
    67126695
     
    67996782          If the machine state is <link to="MachineState_Saved">Saved</link>
    68006783          prior to this operation, the saved state file will be implicitly
    6801           discarded (as if <link to="IConsole::discardSavedState"/> were
     6784          discarded (as if <link to="IConsole::forgetSavedState"/> were
    68026785          called).
    68036786        </note>
     
    68456828          If the machine state is <link to="MachineState_Saved">Saved</link>
    68466829          prior to this operation, the saved state file will be implicitly
    6847           discarded (as if <link to="#discardSavedState"/> were
     6830          discarded (as if <link to="#forgetSavedState"/> were
    68486831          called).
    68496832        </note>
     
    72457228      <param name="description" type="wstring" dir="return">
    72467229        <desc>
    7247           Model string. A NULL string is returned if value is not known or
     7230          Model string. A @c null string is returned if value is not known or
    72487231          @a cpuId is invalid.
    72497232        </desc>
     
    72727255
    72737256    <attribute name="Acceleration3DAvailable" type="boolean" readonly="yes">
    7274       <desc>Returns true when the host supports 3D hardware acceleration.</desc>
     7257      <desc>Returns @c true when the host supports 3D hardware acceleration.</desc>
    72757258    </attribute>
    72767259
     
    73217304      <desc>
    73227305        Creates a new USB device filter. All attributes except
    7323         the filter name are set to <tt>null</tt> (any match),
    7324         <i>active</i> is <tt>false</tt> (the filter is not active).
     7306        the filter name are set to @c null (any match),
     7307        <i>active</i> is @c false (the filter is not active).
    73257308
    73267309        The created filter can be added to the list of filters using
     
    73457328        in the list of filters.
    73467329
    7347         Positions are numbered starting from <tt>0</tt>. If the specified
     7330        Positions are numbered starting from @c 0. If the specified
    73487331        position is equal to or greater than the number of elements in
    73497332        the list, the filter is added at the end of the collection.
     
    73817364        list of filters.
    73827365
    7383         Positions are numbered starting from <tt>0</tt>. Specifying a
     7366        Positions are numbered starting from @c 0. Specifying a
    73847367        position equal to or greater than the number of elements in
    73857368        the list will produce an error.
     
    76137596
    76147597        <note>
    7615           Setting this property to <tt>null</tt> will restore the
     7598          Setting this property to @c null will restore the
    76167599          initial value.
    76177600        </note>
     
    76517634
    76527635        <note>
    7653           Setting this property to <tt>null</tt> will restore the
    7654           initial value.
     7636          Setting this property to @c null will restore the initial value.
    76557637        </note>
    76567638        <note>
     
    77077689        The hard disk format set by this attribute is used by VirtualBox
    77087690        when the hard disk format was not specified explicitly. One example is
    7709         <link to="IVirtualBox::createHardDisk"/> with the <tt>null</tt>
     7691        <link to="IVirtualBox::createHardDisk"/> with the @c null
    77107692        format argument. A more complex example is implicit creation of
    77117693        differencing hard disks when taking a snapshot of a virtual machine:
     
    77207702        unexpectedly.
    77217703
    7722         The initial value of this property is <tt>VDI</tt> in the current
     7704        The initial value of this property is <tt>"VDI"</tt> in the current
    77237705        version of the VirtualBox product, but may change in the future.
    77247706
    77257707        <note>
    7726           Setting this property to <tt>null</tt> will restore the
    7727           initial value.
     7708          Setting this property to @c null will restore the initial value.
    77287709        </note>
    77297710
     
    77467727        system's default library path.
    77477728
    7748         The default value of this property is <tt>VRDPAuth</tt>. There is a library
     7729        The default value of this property is <tt>"VRDPAuth"</tt>. There is a library
    77497730        of that name in one of the default VirtualBox library directories.
    77507731
     
    77537734
    77547735        <note>
    7755           Setting this property to <tt>null</tt> will restore the
     7736          Setting this property to @c null will restore the
    77567737          initial value.
    77577738        </note>
     
    77697750        there is no per-VM setting for this, as the webservice is a global
    77707751        resource (if it is running). Only for this setting (for the webservice),
    7771         setting this value to a literal "null" string disables authentication,
     7752        setting this value to a literal <tt>"null"</tt> string disables authentication,
    77727753        meaning that <link to="IWebsessionManager::logon" /> will always succeed,
    77737754        no matter what user name and password are supplied.
    77747755
    7775         The initial value of this property is <tt>VRDPAuth</tt>,
     7756        The initial value of this property is <tt>"VRDPAuth"</tt>,
    77767757        meaning that the webservice will use the same authentication
    77777758        library that is used by default for VBoxVRDP (again, see
     
    80107991        create and manipulate progress objects, whereas client code
    80117992        can only use the IProgress object to monitor a task's
    8012         progress and, if <link to="#cancelable" /> is true,
     7993        progress and, if <link to="#cancelable" /> is @c true,
    80137994        cancel the task by calling <link to="#cancel" />.
    80147995
     
    80508031        Current progress value of the task as a whole, in percent.
    80518032        This value depends on how many operations are already complete.
    8052         Returns 100 if <link to="#completed" /> is true.
     8033        Returns 100 if <link to="#completed" /> is @c true.
    80538034      </desc>
    80548035    </attribute>
     
    80798060      <desc>
    80808061        Result code of the progress task.
    8081         Valid only if <link to="#completed"/> is true.
     8062        Valid only if <link to="#completed"/> is @c true.
    80828063      </desc>
    80838064    </attribute>
     
    80868067      <desc>
    80878068        Extended information about the unsuccessful result of the
    8088         progress operation. May be NULL if no extended information
     8069        progress operation. May be @c null if no extended information
    80898070        is available.
    8090         Valid only if <link to="#completed"/> is true and
     8071        Valid only if <link to="#completed"/> is @c true and
    80918072        <link to="#resultCode"/> indicates a failure.
    80928073      </desc>
     
    81588139        Cancels the task.
    81598140        <note>
    8160           If <link to="#cancelable"/> is <tt>false</tt>, then
    8161           this method will fail.
     8141          If <link to="#cancelable"/> is @c false, then this method will fail.
    81628142        </note>
    81638143
     
    82368216      cannot be changed.
    82378217
    8238       The current snapshot is <tt>null</tt> if the machine doesn't have
     8218      The current snapshot is @c null if the machine doesn't have
    82398219      snapshots at all; in this case the current machine state is just
    82408220      current settings of this machine plus its current execution state.
     
    83378317    <attribute name="online" type="boolean" readonly="yes">
    83388318      <desc>
    8339         <tt>true</tt> if this snapshot is an online snapshot and
    8340         <tt>false</tt> otherwise.
    8341 
    8342         <note>
    8343           When this attribute is <tt>true</tt>, the
     8319        @c true if this snapshot is an online snapshot and @c false otherwise.
     8320
     8321        <note>
     8322          When this attribute is @c true, the
    83448323          <link to="IMachine::stateFilePath"/> attribute of the
    83458324          <link to="#machine"/> object associated with this snapshot
    83468325          will point to the saved state file. Otherwise, it will be
    8347           <tt>null</tt>.
     8326          @c null.
    83488327        </note>
    83498328      </desc>
     
    83668345        <note>
    83678346          It's not an error to read this attribute on a snapshot
    8368           that doesn't have a parent -- a null object will be
     8347          that doesn't have a parent -- a @c null object will be
    83698348          returned to indicate this.
    83708349        </note>
     
    85228501      created for the first time), all known media are in the
    85238502      <link to="MediaState_Inaccessible"/> state but the value of the <link
    8524       to="#lastAccessError"/> attribute is <tt>null</tt> because no actual
     8503      to="#lastAccessError"/> attribute is @c null because no actual
    85258504      accessibility check is made on startup. This is done to make the
    85268505      VirtualBox object ready for serving requests as
     
    85458524      <desc>
    85468525        Optional description of the medium. For newly created media, the value
    8547         of this attribute value is <tt>null</tt>.
     8526        of this attribute value is @c null.
    85488527
    85498528        Media types that don't support this attribute will return E_NOTIMPL in
     
    85808559        medium is <link to="MediaState_LockedRead"/> or
    85818560        <link to="MediaState_LockedWrite"/> then it remains the same, and a
    8582         non-null value of <link to="#lastAccessError"/> will indicate a failed
     8561        non-@c null value of <link to="#lastAccessError"/> will indicate a failed
    85838562        accessibility check in this case.
    85848563
     
    86538632        Accessibility checks are performed each time the <link to="#state"/>
    86548633        attribute is read. A @c null string is returned if the last
    8655         accessibility check was successful. A non-null string indicates a
     8634        accessibility check was successful. A non-@c null string indicates a
    86568635        failure and should normally describe a reason of the failure (for
    86578636        example, a file read error).
     
    86638642        Array of UUIDs of all machines this medium is attached to.
    86648643
    8665         A <tt>null</tt> array is returned if this medium is not attached to any
     8644        A @c null array is returned if this medium is not attached to any
    86668645        machine or to any machine's snapshot.
    86678646
     
    86888667        the array will contain only snapshot IDs.
    86898668
    8690         The returned array may be <tt>null</tt> if this medium is not attached
     8669        The returned array may be @c null if this medium is not attached
    86918670        to the given machine at all, neither in the current state nor in one of
    86928671        the snapshots.
     
    90289007      querying the <link to="#parent"/> attribute: base hard disks do not have
    90299008      parents they would depend on, so the value of this attribute is always
    9030       <tt>null</tt> for them. Using this attribute, it is possible to walk up
     9009      @c null for them. Using this attribute, it is possible to walk up
    90319010      the hard disk tree (from the child hard disk to its parent). It is also
    90329011      possible to walk down the tree using the <link to="#children"/>
     
    93109289
    93119290        Only differencing hard disks have parents. For base (non-differencing)
    9312         hard disks, <tt>null</tt> is returned.
     9291        hard disks, @c null is returned.
    93139292      </desc>
    93149293    </attribute>
     
    93179296      <desc>
    93189297        Children of this hard disk (all differencing hard disks directly based
    9319         on this hard disk). A <tt>null</tt> array is returned if this hard disk
     9298        on this hard disk). A @c null array is returned if this hard disk
    93209299        does not have any children.
    93219300      </desc>
     
    93359314    <attribute name="readOnly" type="boolean" readonly="yes">
    93369315      <desc>
    9337         Returns <tt>true</tt> if this hard disk is read-only and <tt>false</tt>
    9338         otherwise.
     9316        Returns @c true if this hard disk is read-only and @c false otherwise.
    93399317
    93409318        A hard disk is considered to be read-only when its contents cannot be
     
    93479325        The value of this attribute can be used to determine the kind of the
    93489326        attachment that will take place when attaching this hard disk to a
    9349         virtual machine. If the value is <tt>false</tt> then the hard disk will
    9350         be attached directly. If the value is <tt>true</tt> then the hard disk
     9327        virtual machine. If the value is @c false then the hard disk will
     9328        be attached directly. If the value is @c true then the hard disk
    93519329        will be attached indirectly by creating a new differencing child hard
    93529330        disk for that. See the interface description for more information.
     
    93969374        <note>
    93979375          Reading this property on a base (non-differencing) hard disk will
    9398           always <tt>false</tt>. Changing the value of this property in this
     9376          always @c false. Changing the value of this property in this
    93999377          case is not supported.
    94009378        </note>
     
    94169394        be obtained with <link to="IHardDiskFormat::describeProperties"/>.
    94179395
    9418         Note that if this method returns a <tt>null</tt> @a value, the requested
     9396        Note that if this method returns a @c null @a value, the requested
    94199397        property is supported but currently not assigned any value.
    94209398
     
    94229400          Requested property does not exist (not supported by the format).
    94239401        </result>
    9424         <result name="E_INVALIDARG">@a name is NULL or empty.</result>
     9402        <result name="E_INVALIDARG">@a name is @c null or empty.</result>
    94259403      </desc>
    94269404      <param name="name" type="wstring" dir="in">
     
    94399417        be obtained with <link to="IHardDiskFormat::describeProperties"/>.
    94409418
    9441         Note that setting the property value to <tt>null</tt> is equivalent to
     9419        Note that setting the property value to @c null is equivalent to
    94429420        deleting the existing value. A default value (if it is defined for this
    94439421        property) will be used by the format backend in this case.
     
    94469424          Requested property does not exist (not supported by the format).
    94479425        </result>
    9448         <result name="E_INVALIDARG">@a name is NULL or empty.</result>
     9426        <result name="E_INVALIDARG">@a name is @c null or empty.</result>
    94499427      </desc>
    94509428      <param name="name" type="wstring" dir="in">
     
    94629440        The names of the properties to get are specified using the @a names
    94639441        argument which is a list of comma-separated property names or
    9464         <tt>null</tt> if all properties are to be returned. Note that currently
     9442        @c null if all properties are to be returned. Note that currently
    94659443        the value of this argument is ignored and the method always returns all
    94669444        existing properties.
     
    94769454
    94779455        Note that for properties that do not have assigned values,
    9478         <tt>null</tt> is returned at the appropriate index in the
     9456        @c null is returned at the appropriate index in the
    94799457        @a returnValues array.
    94809458
     
    95149492        be obtained with <link to="IHardDiskFormat::describeProperties"/>.
    95159493
    9516         Note that setting the property value to <tt>null</tt> is equivalent to
     9494        Note that setting the property value to @c null is equivalent to
    95179495        deleting the existing value. A default value (if it is defined for this
    95189496        property) will be used by the format backend in this case.
     
    97379715
    97389716        The @a parent argument defines which hard disk will be the parent
    9739         of the clone. Passing a NULL reference indicates that the clone will
     9717        of the clone. Passing a @c null reference indicates that the clone will
    97409718        be a base image, i.e. completely independent. It is possible to specify
    97419719        an arbitrary hard disk for this parameter, including the parent of the
     
    99409918        Identifier of this format.
    99419919
    9942         The format identifier is a non-null non-empty ASCII string. Note that
     9920        The format identifier is a non-@c null non-empty ASCII string. Note that
    99439921        this string is case-insensitive. This means that, for example, all of
    99449922        the following strings:
     
    99989976        The returned arrays are filled in only if the
    99999977        <link to="HardDiskFormatCapabilities_Properties"/> flag is set.
    10000         All arguments must be non-NULL.
     9978        All arguments must be non-@c null.
    100019979
    100029980        <see>DataType</see>
     
    1037310351      <param name="x" type="long" dir="in">
    1037410352        <desc>
    10375           X coordinate of the pointer in pixels, starting from <tt>1</tt>.
     10353          X coordinate of the pointer in pixels, starting from @c 1.
    1037610354        </desc>
    1037710355      </param>
    1037810356      <param name="y" type="long" dir="in">
    1037910357        <desc>
    10380           Y coordinate of the pointer in pixels, starting from <tt>1</tt>.
     10358          Y coordinate of the pointer in pixels, starting from @c 1.
    1038110359        </desc>
    1038210360      </param>
     
    1039710375            <tr><td>Bit 2 (<tt>0x04</tt>)</td><td>middle mouse button</td></tr>
    1039810376          </table>
    10399           A value of <tt>1</tt> means the corresponding button is pressed.
     10377          A value of @c 1 means the corresponding button is pressed.
    1040010378          otherwise it is released.
    1040110379        </desc>
     
    1051010488        visible until the affected portion of IFramebuffer is updated.  The
    1051110489        overlay can be created lazily the first time it is requested.  This
    10512         attribute can also return NULL to signal that the overlay is not
     10490        attribute can also return @c null to signal that the overlay is not
    1051310491        implemented.
    1051410492      </desc>
     
    1059110569        free to choose which mode to use. To indicate that this frame buffer uses
    1059210570        the direct mode, the implementation of the <link to="#usesGuestVRAM"/>
    10593         attribute must return <tt>true</tt> and <link to="#address"/> must
     10571        attribute must return @c true and <link to="#address"/> must
    1059410572        return exactly the same address that is passed in the @a VRAM parameter
    1059510573        of this method; otherwise it is assumed that the indirect strategy is
     
    1067410652        support a given video mode. In case it is not able to render
    1067510653        the video mode (or for some reason not willing), it should
    10676         return false. Usually this method is called when the guest
     10654        return @c false. Usually this method is called when the guest
    1067710655        asks the VMM device whether a given video mode is supported
    1067810656        so the information returned is directly exposed to the guest.
     
    1068910667        Returns the visible region of this frame buffer.
    1069010668
    10691         If the @a rectangles parameter is <tt>NULL</tt> then the value of the
     10669        If the @a rectangles parameter is @c null then the value of the
    1069210670        @a count parameter is ignored and the number of elements necessary to
    1069310671        describe the current visible region is returned in @a countCopied.
    1069410672
    10695         If @a rectangles is not <tt>NULL</tt> but @a count is less
     10673        If @a rectangles is not @c null but @a count is less
    1069610674        than the required number of elements to store region data, the method
    1069710675        will report a failure. If @a count is equal or greater than the
     
    1070810686      </desc>
    1070910687      <param name="rectangles" type="octet" mod="ptr" dir="in">
    10710         <desc>Pointer to the <tt>RTRECT</tt> array to receive region data.</desc>
     10688        <desc>Pointer to the @c RTRECT array to receive region data.</desc>
    1071110689      </param>
    1071210690      <param name="count" type="unsigned long" dir="in">
    10713         <desc>Number of <tt>RTRECT</tt> elements in the @a rectangles array.</desc>
     10691        <desc>Number of @c RTRECT elements in the @a rectangles array.</desc>
    1071410692      </param>
    1071510693      <param name="countCopied" type="unsigned long" dir="return">
     
    1074010718      </desc>
    1074110719      <param name="rectangles" type="octet" mod="ptr" dir="in">
    10742         <desc>Pointer to the <tt>RTRECT</tt> array.</desc>
     10720        <desc>Pointer to the @c RTRECT array.</desc>
    1074310721      </param>
    1074410722      <param name="count" type="unsigned long" dir="in">
    10745         <desc>Number of <tt>RTRECT</tt> elements in the @a rectangles array.</desc>
     10723        <desc>Number of @c RTRECT elements in the @a rectangles array.</desc>
    1074610724      </param>
    1074710725    </method>
     
    1087010848        after a timeout retry.
    1087110849
    10872         Specifying <tt>0</tt> for either @a width, @a height or @a bitsPerPixel
     10850        Specifying @c 0 for either @a width, @a height or @a bitsPerPixel
    1087310851        parameters means that the corresponding values should be taken from the
    1087410852        current video mode (i.e. left unchanged).
     
    1087610854        If the guest OS supports multi-monitor configuration then the @a display
    1087710855        parameter specifies the number of the guest display to send the hint to:
    10878         <tt>0</tt> is the primary display, <tt>1</tt> is the first secondary and
     10856        @c 0 is the primary display, @c 1 is the first secondary and
    1087910857        so on. If the multi-monitor configuration is not supported, @a display
    10880         must be <tt>0</tt>.
     10858        must be @c 0.
    1088110859
    1088210860        <result name="E_INVALIDARG">
     
    1089710875        <note>
    1089810876          Calling this method has no effect if <link
    10899           to="IGuest::supportsSeamless"/> returns <tt>false</tt>.
     10877          to="IGuest::supportsSeamless"/> returns @c false.
    1090010878        </note>
    1090110879      </desc>
     
    1112011098      <desc>
    1112111099        Ethernet MAC address of the adapter, 12 hexadecimal characters. When setting
    11122         it to NULL, VirtualBox will generate a unique MAC address.
     11100        it to @c null, VirtualBox will generate a unique MAC address.
    1112311101      </desc>
    1112411102    </attribute>
     
    1155711535      <desc>
    1155811536        Creates a new USB device filter. All attributes except
    11559         the filter name are set to <tt>null</tt> (any match),
    11560         <i>active</i> is <tt>false</tt> (the filter is not active).
     11537        the filter name are set to @c null (any match),
     11538        <i>active</i> is @c false (the filter is not active).
    1156111539
    1156211540        The created filter can then be added to the list of filters using
     
    1179511773        </li>
    1179611774        <li><i>Any match</i>. Any value of the corresponding device attribute
    11797           will match the given filter. An empty or <tt>null</tt> string is
     11775          will match the given filter. An empty or @c null string is
    1179811776          used to construct this type of filtering expressions.
    1179911777
     
    1181611794        Visible name for this filter.
    1181711795        This name is used to visually distinguish one filter from another,
    11818         so it can neither be <tt>null</tt> nor an empty string.
     11796        so it can neither be @c null nor an empty string.
    1181911797      </desc>
    1182011798    </attribute>
     
    1230012278        Accessibility checks are performed each time the <link to="#accessible"/>
    1230112279        attribute is read. A @c null string is returned if the last
    12302         accessibility check was successful. A non-null string indicates a
     12280        accessibility check was successful. A non-@c null string indicates a
    1230312281        failure and should normally describe a reason of the failure (for
    1230412282        example, a file read error).
     
    1234412322        Assigns the machine object associated with this direct-type
    1234512323        session or informs the session that it will be a remote one
    12346         (if @a machine == NULL).
     12324        (if @a machine == @c null).
    1234712325
    1234812326        <result name="VBOX_E_INVALID_VM_STATE">
     
    1282612804    </desc>
    1282712805    <const name="Null"         value="0">
    12828       <desc><tt>null</tt> value. Never used by the API.</desc>
     12806      <desc>@c null value. Never used by the API.</desc>
    1282912807    </const>
    1283012808    <const name="IDE"       value="1"/>
     
    1284212820
    1284312821    <const name="Null"         value="0">
    12844       <desc><tt>null</tt> value. Never used by the API.</desc>
     12822      <desc>@c null value. Never used by the API.</desc>
    1284512823    </const>
    1284612824    <const name="LsiLogic"  value="1"/>
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r20727 r20928  
    77
    88/*
    9  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     9 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    125125    STDMETHOD(PowerUp) (IProgress **aProgress);
    126126    STDMETHOD(PowerUpPaused) (IProgress **aProgress);
    127     STDMETHOD(PowerDown)();
    128     STDMETHOD(PowerDownAsync) (IProgress **aProgress);
     127    STDMETHOD(PowerDown) (IProgress **aProgress);
    129128    STDMETHOD(Reset)();
    130129    STDMETHOD(Pause)();
     
    136135    STDMETHOD(SaveState) (IProgress **aProgress);
    137136    STDMETHOD(AdoptSavedState) (IN_BSTR aSavedStateFile);
    138     STDMETHOD(DiscardSavedState)();
     137    STDMETHOD(ForgetSavedState)(BOOL aRemove);
    139138    STDMETHOD(GetDeviceActivity) (DeviceType_T aDeviceType,
    140139                                 DeviceActivity_T *aDeviceActivity);
  • trunk/src/VBox/Main/include/MachineImpl.h

    r19610 r20928  
    906906
    907907    // IInternalMachineControl methods
     908    STDMETHOD(SetRemoveSavedState)(BOOL aRemove);
    908909    STDMETHOD(UpdateState)(MachineState_T machineState);
    909910    STDMETHOD(GetIPCId)(BSTR *id);
     
    10061007    HRESULT updateMachineStateOnClient();
    10071008
     1009    HRESULT mRemoveSavedState;
     1010
    10081011    SnapshotData mSnapshotData;
    10091012
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r19239 r20928  
    55
    66/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2828#include <VBox/com/Guid.h>
    2929#include <VBox/com/ErrorInfo.h>
    30 #include <VBox/com/errorprint_legacy.h>
     30#include <VBox/com/errorprint.h>
    3131#include <VBox/com/EventQueue.h>
    3232
     
    4545#include <iprt/stream.h>
    4646#include <iprt/thread.h>
    47 
    48 #define printf RTPrintf
    4947
    5048
     
    6866
    6967    Bstr name;
    70     printf ("Getting machine name...\n");
    71     CHECK_RC_RET (machine->COMGETTER(Name) (name.asOutParam()));
    72     printf ("Name: {%ls}\n", name.raw());
    73 
    74     printf("Getting machine GUID...\n");
    75     Bstr guid;   
    76     CHECK_RC (machine->COMGETTER(Id) (guid.asOutParam()));
     68    RTPrintf ("Getting machine name...\n");
     69    CHECK_ERROR_RET (machine, COMGETTER(Name) (name.asOutParam()), rc);
     70    RTPrintf ("Name: {%ls}\n", name.raw());
     71
     72    RTPrintf("Getting machine GUID...\n");
     73    Bstr guid;
     74    CHECK_ERROR (machine, COMGETTER(Id) (guid.asOutParam()));
    7775    if (SUCCEEDED (rc) && !guid.isEmpty()) {
    78         printf ("Guid::toString(): {%s}\n", Utf8Str(guid).c_str());
     76        RTPrintf ("Guid::toString(): {%s}\n", Utf8Str(guid).c_str());
    7977    } else {
    80         printf ("WARNING: there's no GUID!");
     78        RTPrintf ("WARNING: there's no GUID!");
    8179    }
    8280
    8381    ULONG memorySize;
    84     printf ("Getting memory size...\n");
    85     CHECK_RC_RET (machine->COMGETTER(MemorySize) (&memorySize));
    86     printf ("Memory size: %d\n", memorySize);
     82    RTPrintf ("Getting memory size...\n");
     83    CHECK_ERROR_RET (machine, COMGETTER(MemorySize) (&memorySize), rc);
     84    RTPrintf ("Memory size: %d\n", memorySize);
    8785
    8886    MachineState_T machineState;
    89     printf ("Getting machine state...\n");
    90     CHECK_RC_RET (machine->COMGETTER(State) (&machineState));
    91     printf ("Machine state: %d\n", machineState);
     87    RTPrintf ("Getting machine state...\n");
     88    CHECK_ERROR_RET (machine, COMGETTER(State) (&machineState), rc);
     89    RTPrintf ("Machine state: %d\n", machineState);
    9290
    9391    BOOL modified;
    94     printf ("Are any settings modified?...\n");
    95     CHECK_RC (machine->COMGETTER(SettingsModified) (&modified));
     92    RTPrintf ("Are any settings modified?...\n");
     93    CHECK_ERROR (machine, COMGETTER(SettingsModified) (&modified));
    9694    if (SUCCEEDED (rc))
    97         printf ("%s\n", modified ? "yes" : "no");
     95        RTPrintf ("%s\n", modified ? "yes" : "no");
    9896
    9997    ULONG memorySizeBig = memorySize * 10;
    100     printf("Changing memory size to %d...\n", memorySizeBig);
    101     CHECK_RC (machine->COMSETTER(MemorySize) (memorySizeBig));
     98    RTPrintf("Changing memory size to %d...\n", memorySizeBig);
     99    CHECK_ERROR (machine, COMSETTER(MemorySize) (memorySizeBig));
    102100
    103101    if (SUCCEEDED (rc))
    104102    {
    105         printf ("Are any settings modified now?...\n");
    106         CHECK_RC_RET (machine->COMGETTER(SettingsModified) (&modified));
    107         printf ("%s\n", modified ? "yes" : "no");
     103        RTPrintf ("Are any settings modified now?...\n");
     104        CHECK_ERROR_RET (machine, COMGETTER(SettingsModified) (&modified), rc);
     105        RTPrintf ("%s\n", modified ? "yes" : "no");
    108106        ASSERT_RET (modified, 0);
    109107
    110108        ULONG memorySizeGot;
    111         printf ("Getting memory size again...\n");
    112         CHECK_RC_RET (machine->COMGETTER(MemorySize) (&memorySizeGot));
    113         printf ("Memory size: %d\n", memorySizeGot);
     109        RTPrintf ("Getting memory size again...\n");
     110        CHECK_ERROR_RET (machine, COMGETTER(MemorySize) (&memorySizeGot), rc);
     111        RTPrintf ("Memory size: %d\n", memorySizeGot);
    114112        ASSERT_RET (memorySizeGot == memorySizeBig, 0);
    115113
    116114        if (readonlyMachine)
    117115        {
    118             printf ("Getting memory size of the counterpart readonly machine...\n");
     116            RTPrintf ("Getting memory size of the counterpart readonly machine...\n");
    119117            ULONG memorySizeRO;
    120118            readonlyMachine->COMGETTER(MemorySize) (&memorySizeRO);
    121             printf ("Memory size: %d\n", memorySizeRO);
     119            RTPrintf ("Memory size: %d\n", memorySizeRO);
    122120            ASSERT_RET (memorySizeRO != memorySizeGot, 0);
    123121        }
    124122
    125         printf ("Discarding recent changes...\n");
    126         CHECK_RC_RET (machine->DiscardSettings());
    127         printf ("Are any settings modified after discarding?...\n");
    128         CHECK_RC_RET (machine->COMGETTER(SettingsModified) (&modified));
    129         printf ("%s\n", modified ? "yes" : "no");
     123        RTPrintf ("Discarding recent changes...\n");
     124        CHECK_ERROR_RET (machine, DiscardSettings(), rc);
     125        RTPrintf ("Are any settings modified after discarding?...\n");
     126        CHECK_ERROR_RET (machine, COMGETTER(SettingsModified) (&modified), rc);
     127        RTPrintf ("%s\n", modified ? "yes" : "no");
    130128        ASSERT_RET (!modified, 0);
    131129
    132         printf ("Getting memory size once more...\n");
    133         CHECK_RC_RET (machine->COMGETTER(MemorySize) (&memorySizeGot));
    134         printf ("Memory size: %d\n", memorySizeGot);
     130        RTPrintf ("Getting memory size once more...\n");
     131        CHECK_ERROR_RET (machine, COMGETTER(MemorySize) (&memorySizeGot), rc);
     132        RTPrintf ("Memory size: %d\n", memorySizeGot);
    135133        ASSERT_RET (memorySizeGot == memorySize, 0);
    136134
    137135        memorySize = memorySize > 128 ? memorySize / 2 : memorySize * 2;
    138         printf("Changing memory size to %d...\n", memorySize);
    139         CHECK_RC_RET (machine->COMSETTER(MemorySize) (memorySize));
     136        RTPrintf("Changing memory size to %d...\n", memorySize);
     137        CHECK_ERROR_RET (machine, COMSETTER(MemorySize) (memorySize), rc);
    140138    }
    141139
    142140    Bstr desc;
    143     printf ("Getting description...\n");
     141    RTPrintf ("Getting description...\n");
    144142    CHECK_ERROR_RET (machine, COMGETTER(Description) (desc.asOutParam()), rc);
    145     printf ("Description is: \"%ls\"\n", desc.raw());
     143    RTPrintf ("Description is: \"%ls\"\n", desc.raw());
    146144
    147145    desc = L"This is an exemplary description (changed).";
    148     printf ("Setting description to \"%ls\"...\n", desc.raw());
     146    RTPrintf ("Setting description to \"%ls\"...\n", desc.raw());
    149147    CHECK_ERROR_RET (machine, COMSETTER(Description) (desc), rc);
    150148
    151     printf ("Saving machine settings...\n");
    152     CHECK_RC (machine->SaveSettings());
     149    RTPrintf ("Saving machine settings...\n");
     150    CHECK_ERROR (machine, SaveSettings());
    153151    if (SUCCEEDED (rc))
    154152    {
    155         printf ("Are any settings modified after saving?...\n");
    156         CHECK_RC_RET (machine->COMGETTER(SettingsModified) (&modified));
    157         printf ("%s\n", modified ? "yes" : "no");
     153        RTPrintf ("Are any settings modified after saving?...\n");
     154        CHECK_ERROR_RET (machine, COMGETTER(SettingsModified) (&modified), rc);
     155        RTPrintf ("%s\n", modified ? "yes" : "no");
    158156        ASSERT_RET (!modified, 0);
    159157
    160158        if (readonlyMachine) {
    161             printf ("Getting memory size of the counterpart readonly machine...\n");
     159            RTPrintf ("Getting memory size of the counterpart readonly machine...\n");
    162160            ULONG memorySizeRO;
    163161            readonlyMachine->COMGETTER(MemorySize) (&memorySizeRO);
    164             printf ("Memory size: %d\n", memorySizeRO);
     162            RTPrintf ("Memory size: %d\n", memorySizeRO);
    165163            ASSERT_RET (memorySizeRO == memorySize, 0);
    166164        }
     
    169167    Bstr extraDataKey = L"Blafasel";
    170168    Bstr extraData;
    171     printf ("Getting extra data key {%ls}...\n", extraDataKey.raw());
    172     CHECK_RC_RET (machine->GetExtraData (extraDataKey, extraData.asOutParam()));
     169    RTPrintf ("Getting extra data key {%ls}...\n", extraDataKey.raw());
     170    CHECK_ERROR_RET (machine, GetExtraData (extraDataKey, extraData.asOutParam()), rc);
    173171    if (!extraData.isEmpty()) {
    174         printf ("Extra data value: {%ls}\n", extraData.raw());
     172        RTPrintf ("Extra data value: {%ls}\n", extraData.raw());
    175173    } else {
    176174        if (extraData.isNull())
    177             printf ("No extra data exists\n");
     175            RTPrintf ("No extra data exists\n");
    178176        else
    179             printf ("Extra data is empty\n");
     177            RTPrintf ("Extra data is empty\n");
    180178    }
    181179
     
    184182    else
    185183        extraData.setNull();
    186     printf (
     184    RTPrintf (
    187185        "Setting extra data key {%ls} to {%ls}...\n",
    188186        extraDataKey.raw(), extraData.raw()
    189187    );
    190     CHECK_RC (machine->SetExtraData (extraDataKey, extraData));
     188    CHECK_ERROR (machine, SetExtraData (extraDataKey, extraData));
    191189
    192190    if (SUCCEEDED (rc)) {
    193         printf ("Getting extra data key {%ls} again...\n", extraDataKey.raw());
    194         CHECK_RC_RET (machine->GetExtraData (extraDataKey, extraData.asOutParam()));
     191        RTPrintf ("Getting extra data key {%ls} again...\n", extraDataKey.raw());
     192        CHECK_ERROR_RET (machine, GetExtraData (extraDataKey, extraData.asOutParam()), rc);
    195193        if (!extraData.isEmpty()) {
    196             printf ("Extra data value: {%ls}\n", extraData.raw());
     194            RTPrintf ("Extra data value: {%ls}\n", extraData.raw());
    197195        } else {
    198196            if (extraData.isNull())
    199                 printf ("No extra data exists\n");
     197                RTPrintf ("No extra data exists\n");
    200198            else
    201                 printf ("Extra data is empty\n");
     199                RTPrintf ("Extra data is empty\n");
    202200        }
    203201    }
     
    222220        char homeDir [RTPATH_MAX];
    223221        GetVBoxUserHomeDirectory (homeDir, sizeof (homeDir));
    224         printf ("VirtualBox Home Directory = '%s'\n", homeDir);
    225     }
    226 
    227     printf ("Initializing COM...\n");
    228 
    229     CHECK_RC_RET (com::Initialize());
     222        RTPrintf ("VirtualBox Home Directory = '%s'\n", homeDir);
     223    }
     224
     225    RTPrintf ("Initializing COM...\n");
     226
     227    rc = com::Initialize();
     228    if (FAILED(rc))
     229    {
     230        RTPrintf("ERROR: failed to initialize COM!\n");
     231        return rc;
     232    }
    230233
    231234    do
     
    242245
    243246    Utf8Str nullUtf8Str;
    244     printf ("nullUtf8Str='%s'\n", nullUtf8Str.raw());
     247    RTPrintf ("nullUtf8Str='%s'\n", nullUtf8Str.raw());
    245248
    246249    Utf8Str simpleUtf8Str = "simpleUtf8Str";
    247     printf ("simpleUtf8Str='%s'\n", simpleUtf8Str.raw());
     250    RTPrintf ("simpleUtf8Str='%s'\n", simpleUtf8Str.raw());
    248251
    249252    Utf8Str utf8StrFmt = Utf8StrFmt ("[0=%d]%s[1=%d]",
    250253                                     0, "utf8StrFmt", 1);
    251     printf ("utf8StrFmt='%s'\n", utf8StrFmt.raw());
    252 
    253 #endif
    254 
    255     printf ("Creating VirtualBox object...\n");
    256     CHECK_RC (virtualBox.createLocalObject (CLSID_VirtualBox));
     254    RTPrintf ("utf8StrFmt='%s'\n", utf8StrFmt.raw());
     255
     256#endif
     257
     258    RTPrintf ("Creating VirtualBox object...\n");
     259    rc = virtualBox.createLocalObject (CLSID_VirtualBox);
     260    if (FAILED(rc))
     261        RTPrintf("ERROR: failed to create the VirtualBox object!\n");
     262    else
     263    {
     264        rc = session.createInprocObject(CLSID_Session);
     265        if (FAILED(rc))
     266            RTPrintf("ERROR: failed to create a session object!\n");
     267    }
     268
    257269    if (FAILED (rc))
    258270    {
    259         CHECK_ERROR_NOCALL();
    260         break;
    261     }
    262 
    263     printf ("Creating Session object...\n");
    264     CHECK_RC (session.createInprocObject (CLSID_Session));
    265     if (FAILED (rc))
    266     {
    267         CHECK_ERROR_NOCALL();
     271        com::ErrorInfo info;
     272        if (!info.isFullAvailable() && !info.isBasicAvailable())
     273        {
     274            com::GluePrintRCMessage(rc);
     275            RTPrintf("Most likely, the VirtualBox COM server is not running or failed to start.\n");
     276        }
     277        else
     278            com::GluePrintErrorInfo(info);
    268279        break;
    269280    }
     
    276287    ////////////////////////////////////////////////////////////////////////////
    277288    {
    278         printf ("Testing VirtualBox::COMGETTER(ProgressOperations)...\n");
     289        RTPrintf ("Testing VirtualBox::COMGETTER(ProgressOperations)...\n");
    279290
    280291        for (;;) {
     
    284295                COMGETTER(ProgressOperations)(ComSafeArrayAsOutParam(operations)));
    285296
    286             printf ("operations: %d\n", operations.size());
     297            RTPrintf ("operations: %d\n", operations.size());
    287298            if (operations.size() == 0)
    288299                break; // No more operations left.
     
    292303
    293304                operations[i]->COMGETTER(Percent)(&percent);
    294                 printf ("operations[%u]: %ld\n", (unsigned)i, (long)percent);
     305                RTPrintf ("operations[%u]: %ld\n", (unsigned)i, (long)percent);
    295306            }
    296307            RTThreadSleep (2000); // msec
     
    306317            ComPtr <IVirtualBox> virtualBox2;
    307318
    308             printf ("Creating one more VirtualBox object...\n");
     319            RTPrintf ("Creating one more VirtualBox object...\n");
    309320            CHECK_RC (virtualBox2.createLocalObject (CLSID_VirtualBox));
    310321            if (FAILED (rc))
     
    314325            }
    315326
    316             printf ("IVirtualBox(virtualBox)=%p IVirtualBox(virtualBox2)=%p\n",
     327            RTPrintf ("IVirtualBox(virtualBox)=%p IVirtualBox(virtualBox2)=%p\n",
    317328                    (IVirtualBox *) virtualBox, (IVirtualBox *) virtualBox2);
    318329            Assert ((IVirtualBox *) virtualBox == (IVirtualBox *) virtualBox2);
     
    322333            unk2 = virtualBox2;
    323334
    324             printf ("IUnknown(virtualBox)=%p IUnknown(virtualBox2)=%p\n",
     335            RTPrintf ("IUnknown(virtualBox)=%p IUnknown(virtualBox2)=%p\n",
    325336                    (IUnknown *) unk, (IUnknown *) unk2);
    326337            Assert ((IUnknown *) unk == (IUnknown *) unk2);
     
    329340            ComPtr <IVirtualBox> vb2 = unk;
    330341
    331             printf ("IVirtualBox(IUnknown(virtualBox))=%p IVirtualBox(IUnknown(virtualBox2))=%p\n",
     342            RTPrintf ("IVirtualBox(IUnknown(virtualBox))=%p IVirtualBox(IUnknown(virtualBox2))=%p\n",
    332343                    (IVirtualBox *) vb, (IVirtualBox *) vb2);
    333344            Assert ((IVirtualBox *) vb == (IVirtualBox *) vb2);
     
    337348            ComPtr <IHost> host;
    338349            CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host)(host.asOutParam()));
    339             printf (" IHost(host)=%p\n", (IHost *) host);
     350            RTPrintf (" IHost(host)=%p\n", (IHost *) host);
    340351            ComPtr <IUnknown> unk = host;
    341             printf (" IUnknown(host)=%p\n", (IUnknown *) unk);
     352            RTPrintf (" IUnknown(host)=%p\n", (IUnknown *) unk);
    342353            ComPtr <IHost> host_copy = unk;
    343             printf (" IHost(host_copy)=%p\n", (IHost *) host_copy);
     354            RTPrintf (" IHost(host_copy)=%p\n", (IHost *) host_copy);
    344355            ComPtr <IUnknown> unk_copy = host_copy;
    345             printf (" IUnknown(host_copy)=%p\n", (IUnknown *) unk_copy);
     356            RTPrintf (" IUnknown(host_copy)=%p\n", (IUnknown *) unk_copy);
    346357            Assert ((IUnknown *) unk == (IUnknown *) unk_copy);
    347358
     
    349360            ComPtr <IUnknown> unk_copy_copy;
    350361            unk_copy.queryInterfaceTo (unk_copy_copy.asOutParam());
    351             printf (" IUnknown(unk_copy)=%p\n", (IUnknown *) unk_copy_copy);
     362            RTPrintf (" IUnknown(unk_copy)=%p\n", (IUnknown *) unk_copy_copy);
    352363            Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy);
    353364            /* query IUnknown on IUnknown in the opposite direction */
    354365            unk_copy_copy.queryInterfaceTo (unk_copy.asOutParam());
    355             printf (" IUnknown(unk_copy_copy)=%p\n", (IUnknown *) unk_copy);
     366            RTPrintf (" IUnknown(unk_copy_copy)=%p\n", (IUnknown *) unk_copy);
    356367            Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy);
    357368
     
    363374            unk_copy_copy.setNull();
    364375            unk = host;
    365             printf (" IUnknown(host)=%p\n", (IUnknown *) unk);
     376            RTPrintf (" IUnknown(host)=%p\n", (IUnknown *) unk);
    366377            Assert (oldUnk == (IUnknown *) unk);
    367378        }
    368379
    369 //        printf ("Will be now released (press Enter)...");
     380//        RTPrintf ("Will be now released (press Enter)...");
    370381//        getchar();
    371382    }
     
    383394        Bstr version;
    384395        CHECK_ERROR_BREAK (virtualBox, COMGETTER(Version) (version.asOutParam()));
    385         printf ("VirtualBox version = %ls\n", version.raw());
     396        RTPrintf ("VirtualBox version = %ls\n", version.raw());
    386397    }
    387398#endif
     
    391402    ////////////////////////////////////////////////////////////////////////////
    392403    {
    393         printf ("Calling IVirtualBox::Machines...\n");
     404        RTPrintf ("Calling IVirtualBox::Machines...\n");
    394405
    395406        com::SafeIfaceArray <IMachine> machines;
     
    397408                           COMGETTER(Machines) (ComSafeArrayAsOutParam (machines)));
    398409
    399         printf ("%u machines registered (machines.isNull()=%d).\n",
     410        RTPrintf ("%u machines registered (machines.isNull()=%d).\n",
    400411                machines.size(), machines.isNull());
    401412
     
    404415            Bstr name;
    405416            CHECK_ERROR_BREAK (machines [i], COMGETTER(Name) (name.asOutParam()));
    406             printf ("machines[%u]='%s'\n", i, Utf8Str (name).raw());
    407         }
    408 
    409 #if 0
    410         {
    411             printf ("Testing [out] arrays...\n");
     417            RTPrintf ("machines[%u]='%s'\n", i, Utf8Str (name).raw());
     418        }
     419
     420#if 0
     421        {
     422            RTPrintf ("Testing [out] arrays...\n");
    412423            com::SafeGUIDArray uuids;
    413424            CHECK_ERROR_BREAK (virtualBox,
     
    415426
    416427            for (size_t i = 0; i < uuids.size(); ++ i)
    417                 printf ("uuids[%u]=%Vuuid\n", i, &uuids [i]);
    418         }
    419 
    420         {
    421             printf ("Testing [in] arrays...\n");
     428                RTPrintf ("uuids[%u]=%Vuuid\n", i, &uuids [i]);
     429        }
     430
     431        {
     432            RTPrintf ("Testing [in] arrays...\n");
    422433            com::SafeGUIDArray uuids (5);
    423434            for (size_t i = 0; i < uuids.size(); ++ i)
     
    426437                id.create();
    427438                uuids [i] = id;
    428                 printf ("uuids[%u]=%Vuuid\n", i, &uuids [i]);
     439                RTPrintf ("uuids[%u]=%Vuuid\n", i, &uuids [i]);
    429440            }
    430441
     
    441452    ////////////////////////////////////////////////////////////////////////////
    442453
    443     printf("Getting IHost interface...\n");
     454    RTPrintf("Getting IHost interface...\n");
    444455    IHost *host;
    445456    rc = virtualBox->GetHost(&host);
     
    458469                dvdDrive->GetDriveName(&driveName);
    459470                RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8);
    460                 printf("Host DVD drive name: %s\n", driveNameUtf8);
     471                RTPrintf("Host DVD drive name: %s\n", driveNameUtf8);
    461472                RTStrFree(driveNameUtf8);
    462473                SysFreeString(driveName);
     
    468479        } else
    469480        {
    470             printf("Could not get host DVD drive collection\n");
     481            RTPrintf("Could not get host DVD drive collection\n");
    471482        }
    472483
     
    483494                floppyDrive->GetDriveName(&driveName);
    484495                RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8);
    485                 printf("Host floppy drive name: %s\n", driveNameUtf8);
     496                RTPrintf("Host floppy drive name: %s\n", driveNameUtf8);
    486497                RTStrFree(driveNameUtf8);
    487498                SysFreeString(driveName);
     
    493504        } else
    494505        {
    495             printf("Could not get host floppy drive collection\n");
     506            RTPrintf("Could not get host floppy drive collection\n");
    496507        }
    497508        host->Release();
    498509    } else
    499510    {
    500         printf("Call failed\n");
    501     }
    502     printf ("\n");
     511        RTPrintf("Call failed\n");
     512    }
     513    RTPrintf ("\n");
    503514#endif
    504515
     
    513524        ComPtr <IHardDisk> hardDisk;
    514525        rc = virtualBox->GetHardDisk(uuid, hardDisk.asOutParam());
    515         printf ("virtualBox->GetHardDisk(null-uuid)=%08X\n", rc);
     526        RTPrintf ("virtualBox->GetHardDisk(null-uuid)=%08X\n", rc);
    516527
    517528//        {
     
    523534        Bstr version;
    524535        rc = virtualBox->COMGETTER(Version) (version.asOutParam());
    525         printf ("virtualBox->COMGETTER(Version)=%08X\n", rc);
     536        RTPrintf ("virtualBox->COMGETTER(Version)=%08X\n", rc);
    526537
    527538        {
     
    535546        ComPtr <IMachine> machine;
    536547        rc = session->COMGETTER(Machine)(machine.asOutParam());
    537         printf ("session->COMGETTER(Machine)=%08X\n", rc);
     548        RTPrintf ("session->COMGETTER(Machine)=%08X\n", rc);
    538549
    539550//        {
     
    545556        SessionState_T state;
    546557        rc = session->COMGETTER(State) (&state);
    547         printf ("session->COMGETTER(State)=%08X\n", rc);
     558        RTPrintf ("session->COMGETTER(State)=%08X\n", rc);
    548559
    549560        {
     
    561572        ComPtr <IHardDisk> hd;
    562573        Bstr src = L"E:\\develop\\innotek\\images\\NewHardDisk.vdi";
    563         printf ("Opening the existing hard disk '%ls'...\n", src.raw());
     574        RTPrintf ("Opening the existing hard disk '%ls'...\n", src.raw());
    564575        CHECK_ERROR_BREAK (virtualBox, OpenHardDisk (src, AccessMode_ReadWrite, hd.asOutParam()));
    565         printf ("Enter to continue...\n");
     576        RTPrintf ("Enter to continue...\n");
    566577        getchar();
    567         printf ("Registering the existing hard disk '%ls'...\n", src.raw());
     578        RTPrintf ("Registering the existing hard disk '%ls'...\n", src.raw());
    568579        CHECK_ERROR_BREAK (virtualBox, RegisterHardDisk (hd));
    569         printf ("Enter to continue...\n");
     580        RTPrintf ("Enter to continue...\n");
    570581        getchar();
    571582    }
    572583    while (FALSE);
    573     printf ("\n");
     584    RTPrintf ("\n");
    574585#endif
    575586
     
    581592        ComPtr <IVirtualDiskImage> vdi;
    582593        Bstr src = L"CreatorTest.vdi";
    583         printf ("Unregistering the hard disk '%ls'...\n", src.raw());
     594        RTPrintf ("Unregistering the hard disk '%ls'...\n", src.raw());
    584595        CHECK_ERROR_BREAK (virtualBox, FindVirtualDiskImage (src, vdi.asOutParam()));
    585596        ComPtr <IHardDisk> hd = vdi;
     
    589600    }
    590601    while (FALSE);
    591     printf ("\n");
     602    RTPrintf ("\n");
    592603#endif
    593604
     
    623634    }
    624635    while (FALSE);
    625     printf ("\n");
     636    RTPrintf ("\n");
    626637#endif
    627638
     
    645656        };
    646657
    647         printf ("\n");
     658        RTPrintf ("\n");
    648659
    649660        for (size_t i = 0; i < RT_ELEMENTS (Names); ++ i)
    650661        {
    651662            Bstr src = Names [i];
    652             printf ("Searching for hard disk '%ls'...\n", src.raw());
     663            RTPrintf ("Searching for hard disk '%ls'...\n", src.raw());
    653664            rc = virtualBox->FindHardDisk (src, hd.asOutParam());
    654665            if (SUCCEEDED (rc))
     
    658669                CHECK_ERROR_BREAK (hd, COMGETTER(Id) (id.asOutParam()));
    659670                CHECK_ERROR_BREAK (hd, COMGETTER(Location) (location.asOutParam()));
    660                 printf ("Found, UUID={%Vuuid}, location='%ls'.\n",
     671                RTPrintf ("Found, UUID={%Vuuid}, location='%ls'.\n",
    661672                        id.raw(), location.raw());
    662673
     
    668679                                                      ComSafeArrayAsOutParam (values)));
    669680
    670                 printf ("Properties:\n");
     681                RTPrintf ("Properties:\n");
    671682                for (size_t i = 0; i < names.size(); ++ i)
    672                     printf (" %ls = %ls\n", names [i], values [i]);
     683                    RTPrintf (" %ls = %ls\n", names [i], values [i]);
    673684
    674685                if (names.size() == 0)
    675                     printf (" <none>\n");
     686                    RTPrintf (" <none>\n");
    676687
    677688#if 0
     
    679690                Bstr value = Utf8StrFmt ("lalala (%llu)", RTTimeMilliTS());
    680691
    681                 printf ("Settings property %ls to %ls...\n", name.raw(), value.raw());
     692                RTPrintf ("Settings property %ls to %ls...\n", name.raw(), value.raw());
    682693                CHECK_ERROR (hd, SetProperty (name, value));
    683694#endif
     
    688699                PRINT_ERROR_INFO (info);
    689700            }
    690             printf ("\n");
     701            RTPrintf ("\n");
    691702        }
    692703    }
    693704    while (FALSE);
    694     printf ("\n");
     705    RTPrintf ("\n");
    695706#endif
    696707
     
    702713        ComPtr <IMachine> machine;
    703714        Bstr name = argc > 1 ? argv [1] : "dos";
    704         printf ("Getting a machine object named '%ls'...\n", name.raw());
     715        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
    705716        CHECK_ERROR_BREAK (virtualBox, FindMachine (name, machine.asOutParam()));
    706         printf ("Accessing the machine in read-only mode:\n");
     717        RTPrintf ("Accessing the machine in read-only mode:\n");
    707718        readAndChangeMachineSettings (machine);
    708719#if 0
    709720        if (argc != 2)
    710721        {
    711             printf ("Error: a string has to be supplied!\n");
     722            RTPrintf ("Error: a string has to be supplied!\n");
    712723        }
    713724        else
     
    719730    }
    720731    while (0);
    721     printf ("\n");
     732    RTPrintf ("\n");
    722733#endif
    723734
     
    735746        Bstr name = L"machina";
    736747
    737         printf ("Creating a new machine object (base dir '%ls', name '%ls')...\n",
     748        RTPrintf ("Creating a new machine object (base dir '%ls', name '%ls')...\n",
    738749                baseDir.raw(), name.raw());
    739750        CHECK_ERROR_BREAK (virtualBox, CreateMachine (baseDir, name,
    740751                                                      machine.asOutParam()));
    741752
    742         printf ("Getting name...\n");
     753        RTPrintf ("Getting name...\n");
    743754        CHECK_ERROR_BREAK (machine, COMGETTER(Name) (name.asOutParam()));
    744         printf ("Name: {%ls}\n", name.raw());
     755        RTPrintf ("Name: {%ls}\n", name.raw());
    745756
    746757        BOOL modified = FALSE;
    747         printf ("Are any settings modified?...\n");
     758        RTPrintf ("Are any settings modified?...\n");
    748759        CHECK_ERROR_BREAK (machine, COMGETTER(SettingsModified) (&modified));
    749         printf ("%s\n", modified ? "yes" : "no");
     760        RTPrintf ("%s\n", modified ? "yes" : "no");
    750761
    751762        ASSERT_BREAK (modified == TRUE);
    752763
    753764        name = L"Kakaya prekrasnaya virtual'naya mashina!";
    754         printf ("Setting new name ({%ls})...\n", name.raw());
     765        RTPrintf ("Setting new name ({%ls})...\n", name.raw());
    755766        CHECK_ERROR_BREAK (machine, COMSETTER(Name) (name));
    756767
    757         printf ("Setting memory size to 111...\n");
     768        RTPrintf ("Setting memory size to 111...\n");
    758769        CHECK_ERROR_BREAK (machine, COMSETTER(MemorySize) (111));
    759770
    760771        Bstr desc = L"This is an exemplary description.";
    761         printf ("Setting description to \"%ls\"...\n", desc.raw());
     772        RTPrintf ("Setting description to \"%ls\"...\n", desc.raw());
    762773        CHECK_ERROR_BREAK (machine, COMSETTER(Description) (desc));
    763774
     
    766777        CHECK_ERROR_BREAK (virtualBox, GetGuestOSType (type, guestOSType.asOutParam()));
    767778
    768         printf ("Saving new machine settings...\n");
     779        RTPrintf ("Saving new machine settings...\n");
    769780        CHECK_ERROR_BREAK (machine, SaveSettings());
    770781
    771         printf ("Accessing the newly created machine:\n");
     782        RTPrintf ("Accessing the newly created machine:\n");
    772783        readAndChangeMachineSettings (machine);
    773784    }
    774785    while (FALSE);
    775     printf ("\n");
     786    RTPrintf ("\n");
    776787#endif
    777788
     
    796807                Bstr name;
    797808                CHECK_RC_BREAK (drive->COMGETTER(Name) (name.asOutParam()));
    798                 printf ("Host DVD drive: name={%ls}\n", name.raw());
     809                RTPrintf ("Host DVD drive: name={%ls}\n", name.raw());
    799810            }
    800811            CHECK_RC_BREAK (rc);
     
    808819                Bstr name;
    809820                CHECK_RC_BREAK (drive->COMGETTER(Name) (name.asOutParam()));
    810                 printf ("Found by name: name={%ls}\n", name.raw());
     821                RTPrintf ("Found by name: name={%ls}\n", name.raw());
    811822            }
    812823        }
    813824    }
    814825    while (FALSE);
    815     printf ("\n");
     826    RTPrintf ("\n");
    816827#endif
    817828
     
    905916                               COMGETTER(HardDisks)(ComSafeArrayAsOutParam (disks)));
    906917
    907             printf ("%u base hard disks registered (disks.isNull()=%d).\n",
     918            RTPrintf ("%u base hard disks registered (disks.isNull()=%d).\n",
    908919                    disks.size(), disks.isNull());
    909920
     
    919930                CHECK_ERROR_BREAK (disks [i], COMGETTER(Format) (format.asOutParam()));
    920931
    921                 printf (" disks[%u]: '%ls'\n"
     932                RTPrintf (" disks[%u]: '%ls'\n"
    922933                        "  UUID:         {%Vuuid}\n"
    923934                        "  State:        %s\n"
     
    937948                    CHECK_ERROR_BREAK (disks [i],
    938949                                       COMGETTER(LastAccessError)(error.asOutParam()));
    939                     printf ("  Access Error: %ls\n", error.raw());
     950                    RTPrintf ("  Access Error: %ls\n", error.raw());
    940951                }
    941952
    942953                /* get usage */
    943954
    944                 printf ("  Used by VMs:\n");
     955                RTPrintf ("  Used by VMs:\n");
    945956
    946957                com::SafeGUIDArray ids;
     
    949960                if (ids.size() == 0)
    950961                {
    951                     printf ("   <not used>\n");
     962                    RTPrintf ("   <not used>\n");
    952963                }
    953964                else
     
    955966                    for (size_t j = 0; j < ids.size(); ++ j)
    956967                    {
    957                         printf ("   {%Vuuid}\n", &ids [j]);
     968                        RTPrintf ("   {%Vuuid}\n", &ids [j]);
    958969                    }
    959970                }
     
    965976                               COMGETTER(DVDImages) (ComSafeArrayAsOutParam (images)));
    966977
    967             printf ("%u DVD images registered (images.isNull()=%d).\n",
     978            RTPrintf ("%u DVD images registered (images.isNull()=%d).\n",
    968979                    images.size(), images.isNull());
    969980
     
    977988                CHECK_ERROR_BREAK (images [i], COMGETTER(State) (&state));
    978989
    979                 printf (" images[%u]: '%ls'\n"
     990                RTPrintf (" images[%u]: '%ls'\n"
    980991                        "  UUID:         {%Vuuid}\n"
    981992                        "  State:        %s\n",
     
    9931004                    CHECK_ERROR_BREAK (images [i],
    9941005                                       COMGETTER(LastAccessError)(error.asOutParam()));
    995                     printf ("  Access Error: %ls\n", error.raw());
     1006                    RTPrintf ("  Access Error: %ls\n", error.raw());
    9961007                }
    9971008
    9981009                /* get usage */
    9991010
    1000                 printf ("  Used by VMs:\n");
     1011                RTPrintf ("  Used by VMs:\n");
    10011012
    10021013                com::SafeGUIDArray ids;
     
    10051016                if (ids.size() == 0)
    10061017                {
    1007                     printf ("   <not used>\n");
     1018                    RTPrintf ("   <not used>\n");
    10081019                }
    10091020                else
     
    10111022                    for (size_t j = 0; j < ids.size(); ++ j)
    10121023                    {
    1013                         printf ("   {%Vuuid}\n", &ids [j]);
     1024                        RTPrintf ("   {%Vuuid}\n", &ids [j]);
    10141025                    }
    10151026                }
     
    10181029    }
    10191030    while (FALSE);
    1020     printf ("\n");
     1031    RTPrintf ("\n");
    10211032#endif
    10221033
     
    10281039        ComPtr <IMachine> machine;
    10291040        Bstr name = argc > 1 ? argv [1] : "dos";
    1030         printf ("Getting a machine object named '%ls'...\n", name.raw());
     1041        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
    10311042        CHECK_ERROR_BREAK (virtualBox, FindMachine (name, machine.asOutParam()));
    10321043        Guid guid;
    10331044        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    1034         printf ("Opening a session for this machine...\n");
     1045        RTPrintf ("Opening a session for this machine...\n");
    10351046        CHECK_RC_BREAK (virtualBox->OpenSession (session, guid));
    10361047#if 1
    10371048        ComPtr <IMachine> sessionMachine;
    1038         printf ("Getting sessioned machine object...\n");
     1049        RTPrintf ("Getting sessioned machine object...\n");
    10391050        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
    1040         printf ("Accessing the machine within the session:\n");
     1051        RTPrintf ("Accessing the machine within the session:\n");
    10411052        readAndChangeMachineSettings (sessionMachine, machine);
    10421053#if 0
    1043         printf ("\n");
    1044         printf ("Enabling the VRDP server (must succeed even if the VM is saved):\n");
     1054        RTPrintf ("\n");
     1055        RTPrintf ("Enabling the VRDP server (must succeed even if the VM is saved):\n");
    10451056        ComPtr <IVRDPServer> vrdp;
    10461057        CHECK_ERROR_BREAK (sessionMachine, COMGETTER(VRDPServer) (vrdp.asOutParam()));
     
    10531064            BOOL enabled = FALSE;
    10541065            CHECK_ERROR_BREAK (vrdp, COMGETTER(Enabled) (&enabled));
    1055             printf ("VRDP server is %s\n", enabled ? "enabled" : "disabled");
     1066            RTPrintf ("VRDP server is %s\n", enabled ? "enabled" : "disabled");
    10561067        }
    10571068#endif
     
    10591070#if 0
    10601071        ComPtr <IConsole> console;
    1061         printf ("Getting the console object...\n");
     1072        RTPrintf ("Getting the console object...\n");
    10621073        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
    1063         printf ("Discarding the current machine state...\n");
     1074        RTPrintf ("Discarding the current machine state...\n");
    10641075        ComPtr <IProgress> progress;
    10651076        CHECK_ERROR_BREAK (console, DiscardCurrentState (progress.asOutParam()));
    1066         printf ("Waiting for completion...\n");
     1077        RTPrintf ("Waiting for completion...\n");
    10671078        CHECK_ERROR_BREAK (progress, WaitForCompletion (-1));
    10681079        ProgressErrorInfo ei (progress);
     
    10741085            CHECK_ERROR_BREAK (progress, COMGETTER(Initiator) (initiator.asOutParam()));
    10751086
    1076             printf ("initiator(unk) = %p\n", (IUnknown *) initiator);
    1077             printf ("console(unk) = %p\n", (IUnknown *) ComPtr <IUnknown> ((IConsole *) console));
    1078             printf ("console = %p\n", (IConsole *) console);
    1079         }
    1080 #endif
    1081         printf("Press enter to close session...");
     1087            RTPrintf ("initiator(unk) = %p\n", (IUnknown *) initiator);
     1088            RTPrintf ("console(unk) = %p\n", (IUnknown *) ComPtr <IUnknown> ((IConsole *) console));
     1089            RTPrintf ("console = %p\n", (IConsole *) console);
     1090        }
     1091#endif
     1092        RTPrintf("Press enter to close session...");
    10821093        getchar();
    10831094        session->Close();
    10841095    }
    10851096    while (FALSE);
    1086     printf ("\n");
     1097    RTPrintf ("\n");
    10871098#endif
    10881099
     
    10941105        ComPtr <IMachine> machine;
    10951106        Bstr name = L"dos";
    1096         printf ("Getting a machine object named '%ls'...\n", name.raw());
     1107        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
    10971108        CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam()));
    10981109        Guid guid;
    10991110        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    1100         printf ("Opening a remote session for this machine...\n");
     1111        RTPrintf ("Opening a remote session for this machine...\n");
    11011112        ComPtr <IProgress> progress;
    11021113        CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, Bstr("gui"),
    11031114                                                       NULL, progress.asOutParam()));
    1104         printf ("Waiting for the session to open...\n");
     1115        RTPrintf ("Waiting for the session to open...\n");
    11051116        CHECK_RC_BREAK (progress->WaitForCompletion (-1));
    11061117        ComPtr <IMachine> sessionMachine;
    1107         printf ("Getting sessioned machine object...\n");
     1118        RTPrintf ("Getting sessioned machine object...\n");
    11081119        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
    11091120        ComPtr <IConsole> console;
    1110         printf ("Getting console object...\n");
     1121        RTPrintf ("Getting console object...\n");
    11111122        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
    1112         printf ("Press enter to pause the VM execution in the remote session...");
     1123        RTPrintf ("Press enter to pause the VM execution in the remote session...");
    11131124        getchar();
    11141125        CHECK_RC (console->Pause());
    1115         printf ("Press enter to close this session...");
     1126        RTPrintf ("Press enter to close this session...");
    11161127        getchar();
    11171128        session->Close();
    11181129    }
    11191130    while (FALSE);
    1120     printf ("\n");
     1131    RTPrintf ("\n");
    11211132#endif
    11221133
     
    11281139        ComPtr <IMachine> machine;
    11291140        Bstr name = "dos";
    1130         printf ("Getting a machine object named '%ls'...\n", name.raw());
     1141        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
    11311142        CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam()));
    11321143        Guid guid;
    11331144        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    1134         printf ("Opening an existing remote session for this machine...\n");
     1145        RTPrintf ("Opening an existing remote session for this machine...\n");
    11351146        CHECK_RC_BREAK (virtualBox->OpenExistingSession (session, guid));
    11361147        ComPtr <IMachine> sessionMachine;
    1137         printf ("Getting sessioned machine object...\n");
     1148        RTPrintf ("Getting sessioned machine object...\n");
    11381149        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
    11391150
     
    11451156#if 0
    11461157        ComPtr <IConsole> console;
    1147         printf ("Getting console object...\n");
     1158        RTPrintf ("Getting console object...\n");
    11481159        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
    1149         printf ("Press enter to pause the VM execution in the remote session...");
     1160        RTPrintf ("Press enter to pause the VM execution in the remote session...");
    11501161        getchar();
    11511162        CHECK_RC (console->Pause());
    1152         printf ("Press enter to close this session...");
     1163        RTPrintf ("Press enter to close this session...");
    11531164        getchar();
    11541165#endif
     
    11561167    }
    11571168    while (FALSE);
    1158     printf ("\n");
     1169    RTPrintf ("\n");
    11591170#endif
    11601171
     
    11671178        ULONG uMemSize, uMemAvail;
    11681179        CHECK_ERROR_BREAK (host, COMGETTER(MemorySize) (&uMemSize));
    1169         printf("Total memory (MB): %u\n", uMemSize);
     1180        RTPrintf("Total memory (MB): %u\n", uMemSize);
    11701181        CHECK_ERROR_BREAK (host, COMGETTER(MemoryAvailable) (&uMemAvail));
    1171         printf("Free memory (MB): %u\n", uMemAvail);
     1182        RTPrintf("Free memory (MB): %u\n", uMemAvail);
    11721183    } while (0);
    11731184#endif
     
    11871198            Bstr interfaceName;
    11881199            networkInterface->COMGETTER(Name)(interfaceName.asOutParam());
    1189             printf("Found %d network interfaces, testing with %lS...\n", hostNetworkInterfaces.size(), interfaceName.raw());
     1200            RTPrintf("Found %d network interfaces, testing with %lS...\n", hostNetworkInterfaces.size(), interfaceName.raw());
    11901201            Guid interfaceGuid;
    11911202            networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam());
     
    11971208            networkInterface->COMGETTER(Id)(interfaceGuid2.asOutParam());
    11981209            if (interfaceGuid2 != interfaceGuid)
    1199                 printf("Failed to retrieve an interface by name %lS.\n", interfaceName.raw());
     1210                RTPrintf("Failed to retrieve an interface by name %lS.\n", interfaceName.raw());
    12001211            // Find the interface by its guid
    12011212            networkInterface.setNull();
     
    12051216            networkInterface->COMGETTER(Name)(interfaceName2.asOutParam());
    12061217            if (interfaceName != interfaceName2)
    1207                 printf("Failed to retrieve an interface by GUID %lS.\n", Bstr(interfaceGuid.toString()).raw());
     1218                RTPrintf("Failed to retrieve an interface by GUID %lS.\n", Bstr(interfaceGuid.toString()).raw());
    12081219        }
    12091220        else
    12101221        {
    1211             printf("No network interfaces found!\n");
     1222            RTPrintf("No network interfaces found!\n");
    12121223        }
    12131224    } while (0);
     
    12351246        Bstr name = argc > 1 ? argv [1] : "dsl";
    12361247        Bstr sessionType = argc > 2 ? argv [2] : "vrdp";
    1237         printf ("Getting a machine object named '%ls'...\n", name.raw());
     1248        RTPrintf ("Getting a machine object named '%ls'...\n", name.raw());
    12381249        CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam()));
    12391250
     
    12411252        Guid guid;
    12421253        CHECK_RC_BREAK (machine->COMGETTER(Id) (guid.asOutParam()));
    1243         printf ("Opening a remote session for this machine...\n");
     1254        RTPrintf ("Opening a remote session for this machine...\n");
    12441255        ComPtr <IProgress> progress;
    12451256        CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, sessionType,
    12461257                                                       NULL, progress.asOutParam()));
    1247         printf ("Waiting for the session to open...\n");
     1258        RTPrintf ("Waiting for the session to open...\n");
    12481259        CHECK_RC_BREAK (progress->WaitForCompletion (-1));
    12491260        ComPtr <IMachine> sessionMachine;
    1250         printf ("Getting sessioned machine object...\n");
     1261        RTPrintf ("Getting sessioned machine object...\n");
    12511262        CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam()));
    12521263
     
    12661277        // Get console
    12671278        ComPtr <IConsole> console;
    1268         printf ("Getting console object...\n");
     1279        RTPrintf ("Getting console object...\n");
    12691280        CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam()));
    12701281
    12711282        RTThreadSleep(5000); // Sleep for 5 seconds
    12721283
    1273         printf("\nMetrics collected with VM running: --------------------\n");
     1284        RTPrintf("\nMetrics collected with VM running: --------------------\n");
    12741285        queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects));
    12751286
    12761287        // Pause
    1277         //printf ("Press enter to pause the VM execution in the remote session...");
     1288        //RTPrintf ("Press enter to pause the VM execution in the remote session...");
    12781289        //getchar();
    12791290        CHECK_RC (console->Pause());
     
    12811292        RTThreadSleep(5000); // Sleep for 5 seconds
    12821293
    1283         printf("\nMetrics collected with VM paused: ---------------------\n");
     1294        RTPrintf("\nMetrics collected with VM paused: ---------------------\n");
    12841295        queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects));
    12851296
    1286         printf("\nDrop collected metrics: ----------------------------------------\n");
     1297        RTPrintf("\nDrop collected metrics: ----------------------------------------\n");
    12871298        CHECK_ERROR_BREAK (collector,
    12881299            SetupMetrics(ComSafeArrayAsInParam(baseMetrics),
     
    12971308        machine.queryInterfaceTo(&vmObject[0]);
    12981309
    1299         printf("\nDisable collection of VM metrics: ------------------------------\n");
     1310        RTPrintf("\nDisable collection of VM metrics: ------------------------------\n");
    13001311        CHECK_ERROR_BREAK (collector,
    13011312            DisableMetrics(ComSafeArrayAsInParam(baseMetrics),
     
    13081319        queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects));
    13091320
    1310         printf("\nRe-enable collection of all metrics: ---------------------------\n");
     1321        RTPrintf("\nRe-enable collection of all metrics: ---------------------------\n");
    13111322        CHECK_ERROR_BREAK (collector,
    13121323            EnableMetrics(ComSafeArrayAsInParam(baseMetrics),
     
    13201331
    13211332        // Power off
    1322         printf ("Press enter to power off VM...");
     1333        RTPrintf ("Press enter to power off VM...");
    13231334        getchar();
    13241335        CHECK_RC (console->PowerDown());
    1325         printf ("Press enter to close this session...");
     1336        RTPrintf ("Press enter to close this session...");
    13261337        getchar();
    13271338        session->Close();
     
    13561367            RTPrintf ("Disks:");
    13571368            for (unsigned i = 0; i < retDisks.size(); i++)
    1358                 printf (" %ls", Bstr (retDisks [i]).raw());
     1369                RTPrintf (" %ls", Bstr (retDisks [i]).raw());
    13591370            RTPrintf ("\n");
    13601371        }
     
    13821393                for (unsigned a = 0; a < retTypes.size(); ++a)
    13831394                {
    1384                     printf (" %d %ls %ls %ls\n",
     1395                    RTPrintf (" %d %ls %ls %ls\n",
    13851396                            retTypes [a],
    13861397                            Bstr (retOrigValues [a]).raw(),
     
    14241435    }
    14251436    while (FALSE);
    1426     printf ("\n");
    1427 #endif
    1428 
    1429     printf ("Press enter to release Session and VirtualBox instances...");
     1437    RTPrintf ("\n");
     1438#endif
     1439
     1440    RTPrintf ("Press enter to release Session and VirtualBox instances...");
    14301441    getchar();
    14311442
     
    14351446    while (0);
    14361447
    1437     printf("Press enter to shutdown COM...");
     1448    RTPrintf("Press enter to shutdown COM...");
    14381449    getchar();
    14391450
    14401451    com::Shutdown();
    14411452
    1442     printf ("tstAPI FINISHED.\n");
     1453    RTPrintf ("tstAPI FINISHED.\n");
    14431454
    14441455    return rc;
  • trunk/src/VBox/Main/webservice/samples/perl/clienttest.pl

    r20827 r20928  
    3939my $optMode;
    4040my $vmname;
     41my $disk;
    4142
    4243while (my $this = shift(@ARGV))
     
    6667        {
    6768            die "[$cmd] Missing parameter: You must specify the name of the VM to start.\nStopped";
     69        }
     70    }
     71    elsif ($this eq 'openhd')
     72    {
     73        $optMode = $this;
     74
     75        if (!($disk = shift(@ARGV)))
     76        {
     77            die "[$cmd] Missing parameter: You must specify the name of the disk to open.\nStopped";
    6878        }
    6979    }
     
    148158    vboxService->IWebsessionManager_logoff($vbox);
    149159}
     160elsif ($optMode eq "openhd")
     161{
     162    my $harddisk = vboxService->IVirtualBox_openHardDisk($vbox, $disk, 1, 0, "", 0, "");
     163}
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r20851 r20928  
    2626#include <VBox/com/Guid.h>
    2727#include <VBox/com/ErrorInfo.h>
    28 #include <VBox/com/errorprint2.h>
     28#include <VBox/com/errorprint.h>
    2929#include <VBox/com/EventQueue.h>
    3030#include <VBox/com/VirtualBox.h>
  • trunk/src/VBox/Main/webservice/websrv-cpp.xsl

    r20888 r20928  
    1010        all SOAP calls into COM/XPCOM method calls.
    1111
    12      Copyright (C) 2006-2008 Sun Microsystems, Inc.
     12     Copyright (C) 2006-2009 Sun Microsystems, Inc.
    1313
    1414     This file is part of VirtualBox Open Source Edition (OSE), as
     
    6666#include <VBox/com/Guid.h>
    6767#include <VBox/com/ErrorInfo.h>
    68 #include <VBox/com/errorprint2.h>
     68#include <VBox/com/errorprint.h>
    6969#include <VBox/com/EventQueue.h>
    7070#include <VBox/com/VirtualBox.h>
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