Changeset 20928 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 25, 2009 11:53:37 AM (16 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r20885 r20928 7 7 8 8 /* 9 * Copyright (C) 2006-200 8Sun Microsystems, Inc.9 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1322 1322 } 1323 1323 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) 1324 STDMETHODIMP Console::PowerDown (IProgress **aProgress) 1360 1325 { 1361 1326 if (aProgress == NULL) … … 1837 1802 } 1838 1803 1839 STDMETHODIMP Console:: DiscardSavedState()1804 STDMETHODIMP Console::ForgetSavedState(BOOL aRemove) 1840 1805 { 1841 1806 AutoCaller autoCaller (this); … … 1850 1815 mMachineState); 1851 1816 1817 HRESULT rc = S_OK; 1818 1819 rc = mControl->SetRemoveSavedState(aRemove); 1820 CheckComRCReturnRC (rc); 1821 1852 1822 /* 1853 1823 * Saved -> PoweredOff transition will be detected in the SessionMachine 1854 1824 * and properly handled. 1855 1825 */ 1856 setMachineState (MachineState_PoweredOff);1857 1858 return S_OK;1826 rc = setMachineState (MachineState_PoweredOff); 1827 1828 return rc; 1859 1829 } 1860 1830 -
trunk/src/VBox/Main/MachineImpl.cpp
r20852 r20928 8240 8240 //////////////////////////////////////////////////////////////////////////////// 8241 8241 8242 DEFINE_EMPTY_CTOR_DTOR (SessionMachine) 8242 SessionMachine::SessionMachine() 8243 : mRemoveSavedState(true) 8244 {} 8245 8246 SessionMachine::~SessionMachine() 8247 {} 8243 8248 8244 8249 HRESULT SessionMachine::FinalConstruct() … … 8686 8691 8687 8692 /** 8693 * @note Locks this object for writing. 8694 */ 8695 STDMETHODIMP 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 /** 8688 8708 * @note Locks the same as #setMachineState() does. 8689 8709 */ … … 11275 11295 } 11276 11296 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) 11284 11300 { 11285 11301 Assert (!mSSData->mStateFilePath.isEmpty()); -
trunk/src/VBox/Main/Makefile.kmk
r20882 r20928 5 5 6 6 # 7 # Copyright (C) 2006-200 7Sun Microsystems, Inc.7 # Copyright (C) 2006-2009 Sun Microsystems, Inc. 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 678 678 glue/EventQueue.cpp \ 679 679 glue/ErrorInfo.cpp \ 680 glue/errorprint 2.cpp \680 glue/errorprint.cpp \ 681 681 glue/SupportErrorInfo.cpp \ 682 682 glue/VirtualBoxErrorInfo.cpp -
trunk/src/VBox/Main/glue/errorprint.cpp
r20914 r20928 3 3 /** @file 4 4 * MS COM / XPCOM Abstraction Layer: 5 * Error info print helpers. This implements the shared code from the macros from errorprint 2.h.5 * Error info print helpers. This implements the shared code from the macros from errorprint.h. 6 6 */ 7 7 … … 24 24 25 25 #include <VBox/com/ErrorInfo.h> 26 #include <VBox/com/errorprint 2.h>26 #include <VBox/com/errorprint.h> 27 27 #include <VBox/log.h> 28 28 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r20897 r20928 233 233 <td> 234 234 Returned if a memory pointer for the output argument is invalid (for 235 example, <tt>NULL</tt>). Note that when pointers representing input235 example, @c null). Note that when pointers representing input 236 236 arguments (such as strings) are invalid, E_INVALIDARG is returned. 237 237 </td> … … 494 494 needed: for any online VM state, the condition 495 495 <tt>FirstOnline <= state <= LastOnline</tt> must be 496 <tt>true</tt>. The same relates to transient states for which496 @c true. The same relates to transient states for which 497 497 the condition <tt>FirstOnline <= state <= LastOnline</tt> must be 498 <tt>true</tt>.498 @c true. 499 499 </note> 500 500 </desc> … … 1027 1027 <desc> 1028 1028 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. 1030 1030 This gives the chance to veto against changes. 1031 1031 </desc> … … 1033 1033 <desc> 1034 1034 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). 1036 1036 </desc> 1037 1037 </param> … … 1118 1118 <param name="registered" type="boolean" dir="in"> 1119 1119 <desc> 1120 If true, the media was registered, otherwise it was1120 If @c true, the media was registered, otherwise it was 1121 1121 unregistered. 1122 1122 </desc> … … 1134 1134 <param name="registered" type="boolean" dir="in"> 1135 1135 <desc> 1136 If true, the machine was registered, otherwise it was1136 If @c true, the machine was registered, otherwise it was 1137 1137 unregistered. 1138 1138 </desc> … … 1183 1183 <param name="snapshotId" type="wstring" dir="in"> 1184 1184 <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). 1188 1187 </desc> 1189 1188 </param> … … 1344 1343 <interface 1345 1344 name="IVirtualBox" extends="$dispatched" 1346 uuid=" 54bf05ec-3fa9-4735-b92e-76e7c6c7e2be"1345 uuid="3f4ab53a-199b-4526-a91a-93ff62e456b8" 1347 1346 wsmap="managed" 1348 1347 > … … 1419 1418 x.y-platform 1420 1419 </pre> 1421 where <tt>x</tt> and <tt>y</tt>are the major and the minor format1422 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. 1423 1422 1424 1423 The current version usually matches the value of the … … 1455 1454 x.y-platform 1456 1455 </pre> 1457 where <tt>x</tt> and <tt>y</tt>are the major and the minor format1458 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. 1459 1458 1460 1459 VirtualBox uses this version of the format when saving settings files … … 1582 1581 directory</link>. 1583 1582 1584 If @a baseFolder is a null or empty string (which is recommended), the1583 If @a baseFolder is a @c null or empty string (which is recommended), the 1585 1584 <link to="ISystemProperties::defaultMachineFolder">default machine 1586 1585 settings folder</link> will be used as a base folder for the created … … 1597 1596 Optionally, you may specify an UUID of to assign to the created machine. 1598 1597 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 automatically1598 (@c null) UUID to this method so that a new UUID will be automatically 1600 1599 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. 1602 1601 1603 1602 <note> … … 1614 1613 </result> 1615 1614 <result name="E_INVALIDARG"> 1616 @a name is empty or null.1615 @a name is empty or @c null. 1617 1616 </result> 1618 1617 </desc> … … 1674 1673 </result> 1675 1674 <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. 1677 1676 </result> 1678 1677 </desc> … … 1722 1721 <note> 1723 1722 <link to="IMachine::settingsModified"/> will return 1724 false for the created machine, until any of machine settings1723 @c false for the created machine, until any of machine settings 1725 1724 are changed. 1726 1725 </note> … … 1867 1866 installation can be obtained using 1868 1867 <link to="ISystemProperties::hardDiskFormats"/>. If the @a format 1869 attribute is empty or <tt>null</tt>then the default storage format1868 attribute is empty or @c null then the default storage format 1870 1869 specified by <link to="ISystemProperties::defaultHardDiskFormat"/> will 1871 1870 be used for creating a storage unit of the hard disk. … … 1883 1882 </result> 1884 1883 <result name="E_INVALIDARG"> 1885 @a format is a null or empty string.1884 @a format is a @c null or empty string. 1886 1885 </result> 1887 1886 </desc> … … 2079 2078 <desc> 2080 2079 UUID to assign to the given image within this VirtualBox installation. 2081 If an empty ( null) UUID is specified, the system will randomly2080 If an empty (@c null) UUID is specified, the system will randomly 2082 2081 generate a new UUID. 2083 2082 </desc> … … 2179 2178 <desc> 2180 2179 UUID to assign to the given image file within this VirtualBox 2181 installation. If an empty ( null) UUID is specified, the system will2180 installation. If an empty (@c null) UUID is specified, the system will 2182 2181 randomly generate a new UUID. 2183 2182 </desc> … … 2313 2312 Returns the global extra data key name following the supplied key. 2314 2313 2315 An error is returned if the supplied @a key does not exist. @c NULLis2314 An error is returned if the supplied @a key does not exist. @c null is 2316 2315 returned in @a nextKey if the supplied key is the last key. When 2317 supplying @c NULLor an empty string for the @a key, the first key item2316 supplying @c null or an empty string for the @a key, the first key item 2318 2317 is returned in @a nextKey (if there is any). @a nextValue is an optional 2319 2318 parameter and if supplied, the next key's value is returned in it. … … 2340 2339 2341 2340 If the requested data @a key does not exist, this function will 2342 succeed and return @c NULLin the @a value argument.2341 succeed and return @c null in the @a value argument. 2343 2342 2344 2343 <result name="VBOX_E_FILE_ERROR"> … … 2362 2361 Sets associated global extra data. 2363 2362 2364 If you pass @c NULLas a key @a value, the given @a key will be2363 If you pass @c null as a key @a value, the given @a key will be 2365 2364 deleted. 2366 2365 … … 2521 2520 argument) are: 2522 2521 <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> 2526 2525 </ul> 2527 2526 … … 2649 2648 2650 2649 <result name="E_INVALIDARG"> 2651 A @c NULLcallback cannot be registered.2650 A @c null callback cannot be registered. 2652 2651 </result> 2653 2652 … … 2807 2806 2808 2807 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 from2808 <tt>.N</tt> suffix to the backup file name (where @c N counts from 2810 2809 0 to 9) and copy it again until it succeeds. If all suffixes are 2811 2810 occupied, or if any other copy error occurs, this method will return a … … 3664 3663 the configuration remains unchanged. Please see the documentation for getDescription() 3665 3664 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. 3667 3666 </desc> 3668 3667 … … 3710 3709 <interface 3711 3710 name="IInternalMachineControl" extends="$unknown" 3712 uuid=" 5595cae1-6b18-42c1-b416-bc7493a87618"3711 uuid="ce8087d7-de92-4bbb-8140-a22fb07f37ba" 3713 3712 internal="yes" 3714 3713 wsmap="suppress" 3715 3714 > 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 3716 3723 <method name="updateState"> 3717 3724 <desc> … … 3758 3765 <method name="detachUSBDevice"> 3759 3766 <desc> 3760 Notification that a VM is going to detach ( done =false) or has3761 already detached ( done =true) the given USB device.3762 When the done =true request is completed, the VM process will3767 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 3763 3770 get a <link to="IInternalSessionControl::onUSBDeviceDetach"/> 3764 3771 notification. 3765 3772 <note> 3766 In the done =true case, the server must run its own filters3773 In the @a done = @c true case, the server must run its own filters 3767 3774 and filters of all VMs but this one on the detached device 3768 3775 as if it were just attached to the host computer. … … 3786 3793 Notification that a VM that is being powered down. The done 3787 3794 parameter indicates whether which stage of the power down 3788 we're at. When done =false the VM is announcing its3789 intentions, while when done =true the VM is reporting3795 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 3790 3797 what it has done. 3791 3798 <note> 3792 In the done =true case, the server must run its own filters3799 In the @a done = @c true case, the server must run its own filters 3793 3800 and filters of all VMs but this one on all detach devices as 3794 3801 if they were just attached to the host computer. … … 3849 3856 3850 3857 <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. 3853 3859 </desc> 3854 3860 </param> … … 3915 3921 3916 3922 <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> 3918 3924 </param> 3919 3925 </method> … … 4197 4203 </ul> 4198 4204 4199 Otherwise, the value of this property is always <tt>true</tt>.4205 Otherwise, the value of this property is always @c true. 4200 4206 4201 4207 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, 4203 4209 the <link to="#accessError"/> property may be used to get the 4204 4210 detailed error information describing the reason of … … 4226 4232 <note> 4227 4233 In the current implementation, once this property returns 4228 <tt>true</tt>, the machine will never become inaccessible4234 @c true, the machine will never become inaccessible 4229 4235 later, even if its settings file cannot be successfully 4230 4236 read/written any more (at least, until the VirtualBox … … 4241 4247 4242 4248 Reading this property is only valid after the last call to 4243 <link to="#accessible"/> returned <tt>false</tt>(i.e. the4244 machine is currently unaccessible). Otherwise, a null4249 <link to="#accessible"/> returned @c false (i.e. the 4250 machine is currently unaccessible). Otherwise, a @c null 4245 4251 IVirtualBoxErrorInfo object will be returned. 4246 4252 </desc> … … 4416 4422 4417 4423 <note> 4418 Setting this property to <tt>null</tt>will restore the4424 Setting this property to @c null will restore the 4419 4425 initial value. 4420 4426 </note> … … 4483 4489 x.y-platform 4484 4490 </pre> 4485 where <tt>x</tt> and <tt>y</tt>are the major and the minor format4486 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. 4487 4493 4488 4494 The current version usually matches the value of the … … 4526 4532 <note> 4527 4533 For newly created unregistered machines, the value of this 4528 property is always TRUEuntil <link to="#saveSettings"/>4534 property is always @c true until <link to="#saveSettings"/> 4529 4535 is called (no matter if any machine settings have been 4530 4536 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). 4532 4538 </note> 4533 4539 </desc> … … 4579 4585 the machine when it is in the <link to="MachineState_Saved"/> state. 4580 4586 <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. 4583 4589 </note> 4584 4590 </desc> … … 4599 4605 Current snapshot of this machine. 4600 4606 <note> 4601 A <tt>null</tt>object is returned if the machine doesn't4607 A @c null object is returned if the machine doesn't 4602 4608 have snapshots. 4603 4609 </note> … … 4615 4621 <attribute name="currentStateModified" type="boolean" readonly="yes"> 4616 4622 <desc> 4617 Returns <tt>true</tt>if the current state of the machine is not4623 Returns @c true if the current state of the machine is not 4618 4624 identical to the state stored in the current snapshot. 4619 4625 … … 4626 4632 <li><link to="IConsole::takeSnapshot"/> (issued on a 4627 4633 powered off or saved machine, for which 4628 <link to="#settingsModified"/> returns <tt>false</tt>)4634 <link to="#settingsModified"/> returns @c false) 4629 4635 </li> 4630 4636 <li><link to="IMachine::setCurrentSnapshot"/> … … 4643 4649 <note> 4644 4650 For machines that don't have snapshots, this property is 4645 always <tt>false</tt>.4651 always @c false. 4646 4652 </note> 4647 4653 </desc> … … 4695 4701 <param name="position" type="unsigned long" dir="in"> 4696 4702 <desc> 4697 Position in the boot order ( <tt>1</tt>to the total number of4703 Position in the boot order (@c 1 to the total number of 4698 4704 devices the machine can boot from, as returned by 4699 4705 <link to="ISystemProperties::maxBootPosition"/>). … … 4729 4735 <param name="position" type="unsigned long" dir="in"> 4730 4736 <desc> 4731 Position in the boot order ( <tt>1</tt>to the total number of4737 Position in the boot order (@c 1 to the total number of 4732 4738 devices the machine can boot from, as returned by 4733 4739 <link to="ISystemProperties::maxBootPosition"/>). … … 5007 5013 supplied key. 5008 5014 5009 An error is returned if the supplied @a key does not exist. @c NULLis5015 An error is returned if the supplied @a key does not exist. @c null is 5010 5016 returned in @a nextKey if the supplied key is the last key. When 5011 supplying @c NULLfor the @a key, the first key item is returned in5017 supplying @c null for the @a key, the first key item is returned in 5012 5018 @a nextKey (if there is any). @a nextValue is an optional parameter and 5013 5019 if supplied, the next key's value is returned in it. … … 5034 5040 5035 5041 If the requested data @a key does not exist, this function will 5036 succeed and return @c NULLin the @a value argument.5042 succeed and return @c null in the @a value argument. 5037 5043 5038 5044 <result name="VBOX_E_FILE_ERROR"> … … 5056 5062 Sets associated machine-specific extra data. 5057 5063 5058 If you pass @c NULLas a key @a value, the given @a key will be5064 If you pass @c null as a key @a value, the given @a key will be 5059 5065 deleted. 5060 5066 … … 5149 5155 5150 5156 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 from5157 <tt>.N</tt> suffix to the backup file name (where @c N counts from 5152 5158 0 to 9) and copy it again until it succeeds. If all suffixes are 5153 5159 occupied, or if any other copy error occurs, this method will return a … … 5215 5221 to succeed. 5216 5222 <note> 5217 <link to="#settingsModified"/> will return TRUEafter this5223 <link to="#settingsModified"/> will return @c true after this 5218 5224 method successfully returns. 5219 5225 </note> … … 5258 5264 <desc> 5259 5265 Returns a snapshot of this machine with the given UUID. 5260 A <tt>null</tt>UUID can be used to obtain the first snapshot5266 A @c null UUID can be used to obtain the first snapshot 5261 5267 taken on this machine. This is useful if you want to traverse 5262 5268 the whole tree of snapshots starting from the root. … … 5367 5373 <param name="canShow" type="boolean" dir="return"> 5368 5374 <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. 5371 5376 </desc> 5372 5377 </param> … … 5564 5569 <desc> 5565 5570 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. 5567 5572 </desc> 5568 5573 </param> … … 5829 5834 <param name="attached" type="boolean" dir="in"> 5830 5835 <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. 5833 5837 </desc> 5834 5838 </param> 5835 5839 <param name="error" type="IVirtualBoxErrorInfo" dir="in"> 5836 5840 <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. 5839 5842 </desc> 5840 5843 </param> … … 5872 5875 5873 5876 <b>Fatal</b> errors are indicated by the @a fatal parameter set 5874 to <tt>true</tt>. In case of fatal errors, the virtual machine5877 to @c true. In case of fatal errors, the virtual machine 5875 5878 execution is always paused before calling this notification, and 5876 5879 the notification handler is supposed either to immediately save … … 5880 5883 5881 5884 <b>Non-fatal</b> errors and warnings are indicated by the 5882 @a fatal parameter set to <tt>false</tt>. If the virtual machine5885 @a fatal parameter set to @c false. If the virtual machine 5883 5886 is in the Paused state by the time the error notification is 5884 5887 received, it means that the user can <i>try to resume</i> the machine … … 5953 5956 <param name="canShow" type="boolean" dir="return"> 5954 5957 <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. 5957 5959 </desc> 5958 5960 </param> … … 6109 6111 <interface 6110 6112 name="IConsole" extends="$unknown" 6111 uuid=" a7f17a42-5b64-488d-977b-4b2c639ada27"6113 uuid="0a51994b-cbc6-4686-94eb-d4e4023280e2" 6112 6114 wsmap="managed" 6113 6115 > … … 6297 6299 <method name="powerDown"> 6298 6300 <desc> 6299 Stops the virtual machine execution.6300 After this operation completes, the machine will go to the6301 PoweredOff state.6302 6303 @deprecated This method will be removed in VirtualBox 2.1 where the6304 powerDownAsync() method will take its name. Do not use this method in6305 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>6317 6301 Initiates the power down procedure to stop the virtual machine 6318 6302 execution. … … 6321 6305 IProgress object. After the operation is complete, the machine will go 6322 6306 to the PoweredOff state. 6323 6324 @warning This method will be renamed to "powerDown" in VirtualBox 2.16325 where the original powerDown() method will be removed. You will need to6326 rename "powerDownAsync" to "powerDown" in your sources to make them6327 build with version 2.1.6328 6307 <result name="VBOX_E_INVALID_VM_STATE"> 6329 6308 Virtual machine must be Running, Paused or Stuck to be powered down. … … 6401 6380 <method name="getGuestEnteredACPIMode"> 6402 6381 <desc>Checks if the guest entered the ACPI mode G0 (working) or 6403 G1 (sleeping). If this method returns false, the guest will6382 G1 (sleeping). If this method returns @c false, the guest will 6404 6383 most likely not respond to external ACPI events. 6405 6384 <result name="VBOX_E_INVALID_VM_STATE"> … … 6483 6462 </method> 6484 6463 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. 6490 6470 <note> 6491 6471 This operation is equivalent to resetting or powering off … … 6496 6476 </result> 6497 6477 </desc> 6478 <param name="remove" type="boolean" dir="in"> 6479 <desc>If @c true remove the saved state file.</desc> 6480 </param> 6498 6481 </method> 6499 6482 … … 6708 6691 children at all (i.e. the first snapshot is the only snapshot of 6709 6692 the machine), both the current and the first snapshot of the 6710 machine will be set to null. In all other cases, the first6693 machine will be set to @c null. In all other cases, the first 6711 6694 snapshot cannot be discarded. 6712 6695 … … 6799 6782 If the machine state is <link to="MachineState_Saved">Saved</link> 6800 6783 prior to this operation, the saved state file will be implicitly 6801 discarded (as if <link to="IConsole:: discardSavedState"/> were6784 discarded (as if <link to="IConsole::forgetSavedState"/> were 6802 6785 called). 6803 6786 </note> … … 6845 6828 If the machine state is <link to="MachineState_Saved">Saved</link> 6846 6829 prior to this operation, the saved state file will be implicitly 6847 discarded (as if <link to="# discardSavedState"/> were6830 discarded (as if <link to="#forgetSavedState"/> were 6848 6831 called). 6849 6832 </note> … … 7245 7228 <param name="description" type="wstring" dir="return"> 7246 7229 <desc> 7247 Model string. A NULLstring is returned if value is not known or7230 Model string. A @c null string is returned if value is not known or 7248 7231 @a cpuId is invalid. 7249 7232 </desc> … … 7272 7255 7273 7256 <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> 7275 7258 </attribute> 7276 7259 … … 7321 7304 <desc> 7322 7305 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). 7325 7308 7326 7309 The created filter can be added to the list of filters using … … 7345 7328 in the list of filters. 7346 7329 7347 Positions are numbered starting from <tt>0</tt>. If the specified7330 Positions are numbered starting from @c 0. If the specified 7348 7331 position is equal to or greater than the number of elements in 7349 7332 the list, the filter is added at the end of the collection. … … 7381 7364 list of filters. 7382 7365 7383 Positions are numbered starting from <tt>0</tt>. Specifying a7366 Positions are numbered starting from @c 0. Specifying a 7384 7367 position equal to or greater than the number of elements in 7385 7368 the list will produce an error. … … 7613 7596 7614 7597 <note> 7615 Setting this property to <tt>null</tt>will restore the7598 Setting this property to @c null will restore the 7616 7599 initial value. 7617 7600 </note> … … 7651 7634 7652 7635 <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. 7655 7637 </note> 7656 7638 <note> … … 7707 7689 The hard disk format set by this attribute is used by VirtualBox 7708 7690 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 7710 7692 format argument. A more complex example is implicit creation of 7711 7693 differencing hard disks when taking a snapshot of a virtual machine: … … 7720 7702 unexpectedly. 7721 7703 7722 The initial value of this property is <tt> VDI</tt> in the current7704 The initial value of this property is <tt>"VDI"</tt> in the current 7723 7705 version of the VirtualBox product, but may change in the future. 7724 7706 7725 7707 <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. 7728 7709 </note> 7729 7710 … … 7746 7727 system's default library path. 7747 7728 7748 The default value of this property is <tt> VRDPAuth</tt>. There is a library7729 The default value of this property is <tt>"VRDPAuth"</tt>. There is a library 7749 7730 of that name in one of the default VirtualBox library directories. 7750 7731 … … 7753 7734 7754 7735 <note> 7755 Setting this property to <tt>null</tt>will restore the7736 Setting this property to @c null will restore the 7756 7737 initial value. 7757 7738 </note> … … 7769 7750 there is no per-VM setting for this, as the webservice is a global 7770 7751 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, 7772 7753 meaning that <link to="IWebsessionManager::logon" /> will always succeed, 7773 7754 no matter what user name and password are supplied. 7774 7755 7775 The initial value of this property is <tt> VRDPAuth</tt>,7756 The initial value of this property is <tt>"VRDPAuth"</tt>, 7776 7757 meaning that the webservice will use the same authentication 7777 7758 library that is used by default for VBoxVRDP (again, see … … 8010 7991 create and manipulate progress objects, whereas client code 8011 7992 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, 8013 7994 cancel the task by calling <link to="#cancel" />. 8014 7995 … … 8050 8031 Current progress value of the task as a whole, in percent. 8051 8032 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. 8053 8034 </desc> 8054 8035 </attribute> … … 8079 8060 <desc> 8080 8061 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. 8082 8063 </desc> 8083 8064 </attribute> … … 8086 8067 <desc> 8087 8068 Extended information about the unsuccessful result of the 8088 progress operation. May be NULLif no extended information8069 progress operation. May be @c null if no extended information 8089 8070 is available. 8090 Valid only if <link to="#completed"/> is true and8071 Valid only if <link to="#completed"/> is @c true and 8091 8072 <link to="#resultCode"/> indicates a failure. 8092 8073 </desc> … … 8158 8139 Cancels the task. 8159 8140 <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. 8162 8142 </note> 8163 8143 … … 8236 8216 cannot be changed. 8237 8217 8238 The current snapshot is <tt>null</tt>if the machine doesn't have8218 The current snapshot is @c null if the machine doesn't have 8239 8219 snapshots at all; in this case the current machine state is just 8240 8220 current settings of this machine plus its current execution state. … … 8337 8317 <attribute name="online" type="boolean" readonly="yes"> 8338 8318 <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 8344 8323 <link to="IMachine::stateFilePath"/> attribute of the 8345 8324 <link to="#machine"/> object associated with this snapshot 8346 8325 will point to the saved state file. Otherwise, it will be 8347 <tt>null</tt>.8326 @c null. 8348 8327 </note> 8349 8328 </desc> … … 8366 8345 <note> 8367 8346 It's not an error to read this attribute on a snapshot 8368 that doesn't have a parent -- a null object will be8347 that doesn't have a parent -- a @c null object will be 8369 8348 returned to indicate this. 8370 8349 </note> … … 8522 8501 created for the first time), all known media are in the 8523 8502 <link to="MediaState_Inaccessible"/> state but the value of the <link 8524 to="#lastAccessError"/> attribute is <tt>null</tt>because no actual8503 to="#lastAccessError"/> attribute is @c null because no actual 8525 8504 accessibility check is made on startup. This is done to make the 8526 8505 VirtualBox object ready for serving requests as … … 8545 8524 <desc> 8546 8525 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. 8548 8527 8549 8528 Media types that don't support this attribute will return E_NOTIMPL in … … 8580 8559 medium is <link to="MediaState_LockedRead"/> or 8581 8560 <link to="MediaState_LockedWrite"/> then it remains the same, and a 8582 non- null value of <link to="#lastAccessError"/> will indicate a failed8561 non-@c null value of <link to="#lastAccessError"/> will indicate a failed 8583 8562 accessibility check in this case. 8584 8563 … … 8653 8632 Accessibility checks are performed each time the <link to="#state"/> 8654 8633 attribute is read. A @c null string is returned if the last 8655 accessibility check was successful. A non- null string indicates a8634 accessibility check was successful. A non-@c null string indicates a 8656 8635 failure and should normally describe a reason of the failure (for 8657 8636 example, a file read error). … … 8663 8642 Array of UUIDs of all machines this medium is attached to. 8664 8643 8665 A <tt>null</tt>array is returned if this medium is not attached to any8644 A @c null array is returned if this medium is not attached to any 8666 8645 machine or to any machine's snapshot. 8667 8646 … … 8688 8667 the array will contain only snapshot IDs. 8689 8668 8690 The returned array may be <tt>null</tt>if this medium is not attached8669 The returned array may be @c null if this medium is not attached 8691 8670 to the given machine at all, neither in the current state nor in one of 8692 8671 the snapshots. … … 9028 9007 querying the <link to="#parent"/> attribute: base hard disks do not have 9029 9008 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 up9009 @c null for them. Using this attribute, it is possible to walk up 9031 9010 the hard disk tree (from the child hard disk to its parent). It is also 9032 9011 possible to walk down the tree using the <link to="#children"/> … … 9310 9289 9311 9290 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. 9313 9292 </desc> 9314 9293 </attribute> … … 9317 9296 <desc> 9318 9297 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 disk9298 on this hard disk). A @c null array is returned if this hard disk 9320 9299 does not have any children. 9321 9300 </desc> … … 9335 9314 <attribute name="readOnly" type="boolean" readonly="yes"> 9336 9315 <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. 9339 9317 9340 9318 A hard disk is considered to be read-only when its contents cannot be … … 9347 9325 The value of this attribute can be used to determine the kind of the 9348 9326 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 will9350 be attached directly. If the value is <tt>true</tt>then the hard disk9327 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 9351 9329 will be attached indirectly by creating a new differencing child hard 9352 9330 disk for that. See the interface description for more information. … … 9396 9374 <note> 9397 9375 Reading this property on a base (non-differencing) hard disk will 9398 always <tt>false</tt>. Changing the value of this property in this9376 always @c false. Changing the value of this property in this 9399 9377 case is not supported. 9400 9378 </note> … … 9416 9394 be obtained with <link to="IHardDiskFormat::describeProperties"/>. 9417 9395 9418 Note that if this method returns a <tt>null</tt>@a value, the requested9396 Note that if this method returns a @c null @a value, the requested 9419 9397 property is supported but currently not assigned any value. 9420 9398 … … 9422 9400 Requested property does not exist (not supported by the format). 9423 9401 </result> 9424 <result name="E_INVALIDARG">@a name is NULLor empty.</result>9402 <result name="E_INVALIDARG">@a name is @c null or empty.</result> 9425 9403 </desc> 9426 9404 <param name="name" type="wstring" dir="in"> … … 9439 9417 be obtained with <link to="IHardDiskFormat::describeProperties"/>. 9440 9418 9441 Note that setting the property value to <tt>null</tt>is equivalent to9419 Note that setting the property value to @c null is equivalent to 9442 9420 deleting the existing value. A default value (if it is defined for this 9443 9421 property) will be used by the format backend in this case. … … 9446 9424 Requested property does not exist (not supported by the format). 9447 9425 </result> 9448 <result name="E_INVALIDARG">@a name is NULLor empty.</result>9426 <result name="E_INVALIDARG">@a name is @c null or empty.</result> 9449 9427 </desc> 9450 9428 <param name="name" type="wstring" dir="in"> … … 9462 9440 The names of the properties to get are specified using the @a names 9463 9441 argument which is a list of comma-separated property names or 9464 <tt>null</tt>if all properties are to be returned. Note that currently9442 @c null if all properties are to be returned. Note that currently 9465 9443 the value of this argument is ignored and the method always returns all 9466 9444 existing properties. … … 9476 9454 9477 9455 Note that for properties that do not have assigned values, 9478 <tt>null</tt>is returned at the appropriate index in the9456 @c null is returned at the appropriate index in the 9479 9457 @a returnValues array. 9480 9458 … … 9514 9492 be obtained with <link to="IHardDiskFormat::describeProperties"/>. 9515 9493 9516 Note that setting the property value to <tt>null</tt>is equivalent to9494 Note that setting the property value to @c null is equivalent to 9517 9495 deleting the existing value. A default value (if it is defined for this 9518 9496 property) will be used by the format backend in this case. … … 9737 9715 9738 9716 The @a parent argument defines which hard disk will be the parent 9739 of the clone. Passing a NULLreference indicates that the clone will9717 of the clone. Passing a @c null reference indicates that the clone will 9740 9718 be a base image, i.e. completely independent. It is possible to specify 9741 9719 an arbitrary hard disk for this parameter, including the parent of the … … 9940 9918 Identifier of this format. 9941 9919 9942 The format identifier is a non- null non-empty ASCII string. Note that9920 The format identifier is a non-@c null non-empty ASCII string. Note that 9943 9921 this string is case-insensitive. This means that, for example, all of 9944 9922 the following strings: … … 9998 9976 The returned arrays are filled in only if the 9999 9977 <link to="HardDiskFormatCapabilities_Properties"/> flag is set. 10000 All arguments must be non- NULL.9978 All arguments must be non-@c null. 10001 9979 10002 9980 <see>DataType</see> … … 10373 10351 <param name="x" type="long" dir="in"> 10374 10352 <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. 10376 10354 </desc> 10377 10355 </param> 10378 10356 <param name="y" type="long" dir="in"> 10379 10357 <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. 10381 10359 </desc> 10382 10360 </param> … … 10397 10375 <tr><td>Bit 2 (<tt>0x04</tt>)</td><td>middle mouse button</td></tr> 10398 10376 </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. 10400 10378 otherwise it is released. 10401 10379 </desc> … … 10510 10488 visible until the affected portion of IFramebuffer is updated. The 10511 10489 overlay can be created lazily the first time it is requested. This 10512 attribute can also return NULLto signal that the overlay is not10490 attribute can also return @c null to signal that the overlay is not 10513 10491 implemented. 10514 10492 </desc> … … 10591 10569 free to choose which mode to use. To indicate that this frame buffer uses 10592 10570 the direct mode, the implementation of the <link to="#usesGuestVRAM"/> 10593 attribute must return <tt>true</tt>and <link to="#address"/> must10571 attribute must return @c true and <link to="#address"/> must 10594 10572 return exactly the same address that is passed in the @a VRAM parameter 10595 10573 of this method; otherwise it is assumed that the indirect strategy is … … 10674 10652 support a given video mode. In case it is not able to render 10675 10653 the video mode (or for some reason not willing), it should 10676 return false. Usually this method is called when the guest10654 return @c false. Usually this method is called when the guest 10677 10655 asks the VMM device whether a given video mode is supported 10678 10656 so the information returned is directly exposed to the guest. … … 10689 10667 Returns the visible region of this frame buffer. 10690 10668 10691 If the @a rectangles parameter is <tt>NULL</tt>then the value of the10669 If the @a rectangles parameter is @c null then the value of the 10692 10670 @a count parameter is ignored and the number of elements necessary to 10693 10671 describe the current visible region is returned in @a countCopied. 10694 10672 10695 If @a rectangles is not <tt>NULL</tt>but @a count is less10673 If @a rectangles is not @c null but @a count is less 10696 10674 than the required number of elements to store region data, the method 10697 10675 will report a failure. If @a count is equal or greater than the … … 10708 10686 </desc> 10709 10687 <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> 10711 10689 </param> 10712 10690 <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> 10714 10692 </param> 10715 10693 <param name="countCopied" type="unsigned long" dir="return"> … … 10740 10718 </desc> 10741 10719 <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> 10743 10721 </param> 10744 10722 <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> 10746 10724 </param> 10747 10725 </method> … … 10870 10848 after a timeout retry. 10871 10849 10872 Specifying <tt>0</tt>for either @a width, @a height or @a bitsPerPixel10850 Specifying @c 0 for either @a width, @a height or @a bitsPerPixel 10873 10851 parameters means that the corresponding values should be taken from the 10874 10852 current video mode (i.e. left unchanged). … … 10876 10854 If the guest OS supports multi-monitor configuration then the @a display 10877 10855 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 and10856 @c 0 is the primary display, @c 1 is the first secondary and 10879 10857 so on. If the multi-monitor configuration is not supported, @a display 10880 must be <tt>0</tt>.10858 must be @c 0. 10881 10859 10882 10860 <result name="E_INVALIDARG"> … … 10897 10875 <note> 10898 10876 Calling this method has no effect if <link 10899 to="IGuest::supportsSeamless"/> returns <tt>false</tt>.10877 to="IGuest::supportsSeamless"/> returns @c false. 10900 10878 </note> 10901 10879 </desc> … … 11120 11098 <desc> 11121 11099 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. 11123 11101 </desc> 11124 11102 </attribute> … … 11557 11535 <desc> 11558 11536 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). 11561 11539 11562 11540 The created filter can then be added to the list of filters using … … 11795 11773 </li> 11796 11774 <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 is11775 will match the given filter. An empty or @c null string is 11798 11776 used to construct this type of filtering expressions. 11799 11777 … … 11816 11794 Visible name for this filter. 11817 11795 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. 11819 11797 </desc> 11820 11798 </attribute> … … 12300 12278 Accessibility checks are performed each time the <link to="#accessible"/> 12301 12279 attribute is read. A @c null string is returned if the last 12302 accessibility check was successful. A non- null string indicates a12280 accessibility check was successful. A non-@c null string indicates a 12303 12281 failure and should normally describe a reason of the failure (for 12304 12282 example, a file read error). … … 12344 12322 Assigns the machine object associated with this direct-type 12345 12323 session or informs the session that it will be a remote one 12346 (if @a machine == NULL).12324 (if @a machine == @c null). 12347 12325 12348 12326 <result name="VBOX_E_INVALID_VM_STATE"> … … 12826 12804 </desc> 12827 12805 <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> 12829 12807 </const> 12830 12808 <const name="IDE" value="1"/> … … 12842 12820 12843 12821 <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> 12845 12823 </const> 12846 12824 <const name="LsiLogic" value="1"/> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r20727 r20928 7 7 8 8 /* 9 * Copyright (C) 2006-200 8Sun Microsystems, Inc.9 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 125 125 STDMETHOD(PowerUp) (IProgress **aProgress); 126 126 STDMETHOD(PowerUpPaused) (IProgress **aProgress); 127 STDMETHOD(PowerDown)(); 128 STDMETHOD(PowerDownAsync) (IProgress **aProgress); 127 STDMETHOD(PowerDown) (IProgress **aProgress); 129 128 STDMETHOD(Reset)(); 130 129 STDMETHOD(Pause)(); … … 136 135 STDMETHOD(SaveState) (IProgress **aProgress); 137 136 STDMETHOD(AdoptSavedState) (IN_BSTR aSavedStateFile); 138 STDMETHOD( DiscardSavedState)();137 STDMETHOD(ForgetSavedState)(BOOL aRemove); 139 138 STDMETHOD(GetDeviceActivity) (DeviceType_T aDeviceType, 140 139 DeviceActivity_T *aDeviceActivity); -
trunk/src/VBox/Main/include/MachineImpl.h
r19610 r20928 906 906 907 907 // IInternalMachineControl methods 908 STDMETHOD(SetRemoveSavedState)(BOOL aRemove); 908 909 STDMETHOD(UpdateState)(MachineState_T machineState); 909 910 STDMETHOD(GetIPCId)(BSTR *id); … … 1006 1007 HRESULT updateMachineStateOnClient(); 1007 1008 1009 HRESULT mRemoveSavedState; 1010 1008 1011 SnapshotData mSnapshotData; 1009 1012 -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r19239 r20928 5 5 6 6 /* 7 * Copyright (C) 2006-200 7Sun Microsystems, Inc.7 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 28 28 #include <VBox/com/Guid.h> 29 29 #include <VBox/com/ErrorInfo.h> 30 #include <VBox/com/errorprint _legacy.h>30 #include <VBox/com/errorprint.h> 31 31 #include <VBox/com/EventQueue.h> 32 32 … … 45 45 #include <iprt/stream.h> 46 46 #include <iprt/thread.h> 47 48 #define printf RTPrintf49 47 50 48 … … 68 66 69 67 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())); 77 75 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()); 79 77 } else { 80 printf ("WARNING: there's no GUID!");78 RTPrintf ("WARNING: there's no GUID!"); 81 79 } 82 80 83 81 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); 87 85 88 86 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); 92 90 93 91 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)); 96 94 if (SUCCEEDED (rc)) 97 printf ("%s\n", modified ? "yes" : "no");95 RTPrintf ("%s\n", modified ? "yes" : "no"); 98 96 99 97 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)); 102 100 103 101 if (SUCCEEDED (rc)) 104 102 { 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"); 108 106 ASSERT_RET (modified, 0); 109 107 110 108 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); 114 112 ASSERT_RET (memorySizeGot == memorySizeBig, 0); 115 113 116 114 if (readonlyMachine) 117 115 { 118 printf ("Getting memory size of the counterpart readonly machine...\n");116 RTPrintf ("Getting memory size of the counterpart readonly machine...\n"); 119 117 ULONG memorySizeRO; 120 118 readonlyMachine->COMGETTER(MemorySize) (&memorySizeRO); 121 printf ("Memory size: %d\n", memorySizeRO);119 RTPrintf ("Memory size: %d\n", memorySizeRO); 122 120 ASSERT_RET (memorySizeRO != memorySizeGot, 0); 123 121 } 124 122 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"); 130 128 ASSERT_RET (!modified, 0); 131 129 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); 135 133 ASSERT_RET (memorySizeGot == memorySize, 0); 136 134 137 135 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); 140 138 } 141 139 142 140 Bstr desc; 143 printf ("Getting description...\n");141 RTPrintf ("Getting description...\n"); 144 142 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()); 146 144 147 145 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()); 149 147 CHECK_ERROR_RET (machine, COMSETTER(Description) (desc), rc); 150 148 151 printf ("Saving machine settings...\n");152 CHECK_ RC (machine->SaveSettings());149 RTPrintf ("Saving machine settings...\n"); 150 CHECK_ERROR (machine, SaveSettings()); 153 151 if (SUCCEEDED (rc)) 154 152 { 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"); 158 156 ASSERT_RET (!modified, 0); 159 157 160 158 if (readonlyMachine) { 161 printf ("Getting memory size of the counterpart readonly machine...\n");159 RTPrintf ("Getting memory size of the counterpart readonly machine...\n"); 162 160 ULONG memorySizeRO; 163 161 readonlyMachine->COMGETTER(MemorySize) (&memorySizeRO); 164 printf ("Memory size: %d\n", memorySizeRO);162 RTPrintf ("Memory size: %d\n", memorySizeRO); 165 163 ASSERT_RET (memorySizeRO == memorySize, 0); 166 164 } … … 169 167 Bstr extraDataKey = L"Blafasel"; 170 168 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); 173 171 if (!extraData.isEmpty()) { 174 printf ("Extra data value: {%ls}\n", extraData.raw());172 RTPrintf ("Extra data value: {%ls}\n", extraData.raw()); 175 173 } else { 176 174 if (extraData.isNull()) 177 printf ("No extra data exists\n");175 RTPrintf ("No extra data exists\n"); 178 176 else 179 printf ("Extra data is empty\n");177 RTPrintf ("Extra data is empty\n"); 180 178 } 181 179 … … 184 182 else 185 183 extraData.setNull(); 186 printf (184 RTPrintf ( 187 185 "Setting extra data key {%ls} to {%ls}...\n", 188 186 extraDataKey.raw(), extraData.raw() 189 187 ); 190 CHECK_ RC (machine->SetExtraData (extraDataKey, extraData));188 CHECK_ERROR (machine, SetExtraData (extraDataKey, extraData)); 191 189 192 190 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); 195 193 if (!extraData.isEmpty()) { 196 printf ("Extra data value: {%ls}\n", extraData.raw());194 RTPrintf ("Extra data value: {%ls}\n", extraData.raw()); 197 195 } else { 198 196 if (extraData.isNull()) 199 printf ("No extra data exists\n");197 RTPrintf ("No extra data exists\n"); 200 198 else 201 printf ("Extra data is empty\n");199 RTPrintf ("Extra data is empty\n"); 202 200 } 203 201 } … … 222 220 char homeDir [RTPATH_MAX]; 223 221 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 } 230 233 231 234 do … … 242 245 243 246 Utf8Str nullUtf8Str; 244 printf ("nullUtf8Str='%s'\n", nullUtf8Str.raw());247 RTPrintf ("nullUtf8Str='%s'\n", nullUtf8Str.raw()); 245 248 246 249 Utf8Str simpleUtf8Str = "simpleUtf8Str"; 247 printf ("simpleUtf8Str='%s'\n", simpleUtf8Str.raw());250 RTPrintf ("simpleUtf8Str='%s'\n", simpleUtf8Str.raw()); 248 251 249 252 Utf8Str utf8StrFmt = Utf8StrFmt ("[0=%d]%s[1=%d]", 250 253 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 257 269 if (FAILED (rc)) 258 270 { 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); 268 279 break; 269 280 } … … 276 287 //////////////////////////////////////////////////////////////////////////// 277 288 { 278 printf ("Testing VirtualBox::COMGETTER(ProgressOperations)...\n");289 RTPrintf ("Testing VirtualBox::COMGETTER(ProgressOperations)...\n"); 279 290 280 291 for (;;) { … … 284 295 COMGETTER(ProgressOperations)(ComSafeArrayAsOutParam(operations))); 285 296 286 printf ("operations: %d\n", operations.size());297 RTPrintf ("operations: %d\n", operations.size()); 287 298 if (operations.size() == 0) 288 299 break; // No more operations left. … … 292 303 293 304 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); 295 306 } 296 307 RTThreadSleep (2000); // msec … … 306 317 ComPtr <IVirtualBox> virtualBox2; 307 318 308 printf ("Creating one more VirtualBox object...\n");319 RTPrintf ("Creating one more VirtualBox object...\n"); 309 320 CHECK_RC (virtualBox2.createLocalObject (CLSID_VirtualBox)); 310 321 if (FAILED (rc)) … … 314 325 } 315 326 316 printf ("IVirtualBox(virtualBox)=%p IVirtualBox(virtualBox2)=%p\n",327 RTPrintf ("IVirtualBox(virtualBox)=%p IVirtualBox(virtualBox2)=%p\n", 317 328 (IVirtualBox *) virtualBox, (IVirtualBox *) virtualBox2); 318 329 Assert ((IVirtualBox *) virtualBox == (IVirtualBox *) virtualBox2); … … 322 333 unk2 = virtualBox2; 323 334 324 printf ("IUnknown(virtualBox)=%p IUnknown(virtualBox2)=%p\n",335 RTPrintf ("IUnknown(virtualBox)=%p IUnknown(virtualBox2)=%p\n", 325 336 (IUnknown *) unk, (IUnknown *) unk2); 326 337 Assert ((IUnknown *) unk == (IUnknown *) unk2); … … 329 340 ComPtr <IVirtualBox> vb2 = unk; 330 341 331 printf ("IVirtualBox(IUnknown(virtualBox))=%p IVirtualBox(IUnknown(virtualBox2))=%p\n",342 RTPrintf ("IVirtualBox(IUnknown(virtualBox))=%p IVirtualBox(IUnknown(virtualBox2))=%p\n", 332 343 (IVirtualBox *) vb, (IVirtualBox *) vb2); 333 344 Assert ((IVirtualBox *) vb == (IVirtualBox *) vb2); … … 337 348 ComPtr <IHost> host; 338 349 CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host)(host.asOutParam())); 339 printf (" IHost(host)=%p\n", (IHost *) host);350 RTPrintf (" IHost(host)=%p\n", (IHost *) host); 340 351 ComPtr <IUnknown> unk = host; 341 printf (" IUnknown(host)=%p\n", (IUnknown *) unk);352 RTPrintf (" IUnknown(host)=%p\n", (IUnknown *) unk); 342 353 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); 344 355 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); 346 357 Assert ((IUnknown *) unk == (IUnknown *) unk_copy); 347 358 … … 349 360 ComPtr <IUnknown> unk_copy_copy; 350 361 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); 352 363 Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy); 353 364 /* query IUnknown on IUnknown in the opposite direction */ 354 365 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); 356 367 Assert ((IUnknown *) unk_copy == (IUnknown *) unk_copy_copy); 357 368 … … 363 374 unk_copy_copy.setNull(); 364 375 unk = host; 365 printf (" IUnknown(host)=%p\n", (IUnknown *) unk);376 RTPrintf (" IUnknown(host)=%p\n", (IUnknown *) unk); 366 377 Assert (oldUnk == (IUnknown *) unk); 367 378 } 368 379 369 // printf ("Will be now released (press Enter)...");380 // RTPrintf ("Will be now released (press Enter)..."); 370 381 // getchar(); 371 382 } … … 383 394 Bstr version; 384 395 CHECK_ERROR_BREAK (virtualBox, COMGETTER(Version) (version.asOutParam())); 385 printf ("VirtualBox version = %ls\n", version.raw());396 RTPrintf ("VirtualBox version = %ls\n", version.raw()); 386 397 } 387 398 #endif … … 391 402 //////////////////////////////////////////////////////////////////////////// 392 403 { 393 printf ("Calling IVirtualBox::Machines...\n");404 RTPrintf ("Calling IVirtualBox::Machines...\n"); 394 405 395 406 com::SafeIfaceArray <IMachine> machines; … … 397 408 COMGETTER(Machines) (ComSafeArrayAsOutParam (machines))); 398 409 399 printf ("%u machines registered (machines.isNull()=%d).\n",410 RTPrintf ("%u machines registered (machines.isNull()=%d).\n", 400 411 machines.size(), machines.isNull()); 401 412 … … 404 415 Bstr name; 405 416 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"); 412 423 com::SafeGUIDArray uuids; 413 424 CHECK_ERROR_BREAK (virtualBox, … … 415 426 416 427 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"); 422 433 com::SafeGUIDArray uuids (5); 423 434 for (size_t i = 0; i < uuids.size(); ++ i) … … 426 437 id.create(); 427 438 uuids [i] = id; 428 printf ("uuids[%u]=%Vuuid\n", i, &uuids [i]);439 RTPrintf ("uuids[%u]=%Vuuid\n", i, &uuids [i]); 429 440 } 430 441 … … 441 452 //////////////////////////////////////////////////////////////////////////// 442 453 443 printf("Getting IHost interface...\n");454 RTPrintf("Getting IHost interface...\n"); 444 455 IHost *host; 445 456 rc = virtualBox->GetHost(&host); … … 458 469 dvdDrive->GetDriveName(&driveName); 459 470 RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8); 460 printf("Host DVD drive name: %s\n", driveNameUtf8);471 RTPrintf("Host DVD drive name: %s\n", driveNameUtf8); 461 472 RTStrFree(driveNameUtf8); 462 473 SysFreeString(driveName); … … 468 479 } else 469 480 { 470 printf("Could not get host DVD drive collection\n");481 RTPrintf("Could not get host DVD drive collection\n"); 471 482 } 472 483 … … 483 494 floppyDrive->GetDriveName(&driveName); 484 495 RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8); 485 printf("Host floppy drive name: %s\n", driveNameUtf8);496 RTPrintf("Host floppy drive name: %s\n", driveNameUtf8); 486 497 RTStrFree(driveNameUtf8); 487 498 SysFreeString(driveName); … … 493 504 } else 494 505 { 495 printf("Could not get host floppy drive collection\n");506 RTPrintf("Could not get host floppy drive collection\n"); 496 507 } 497 508 host->Release(); 498 509 } else 499 510 { 500 printf("Call failed\n");501 } 502 printf ("\n");511 RTPrintf("Call failed\n"); 512 } 513 RTPrintf ("\n"); 503 514 #endif 504 515 … … 513 524 ComPtr <IHardDisk> hardDisk; 514 525 rc = virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); 515 printf ("virtualBox->GetHardDisk(null-uuid)=%08X\n", rc);526 RTPrintf ("virtualBox->GetHardDisk(null-uuid)=%08X\n", rc); 516 527 517 528 // { … … 523 534 Bstr version; 524 535 rc = virtualBox->COMGETTER(Version) (version.asOutParam()); 525 printf ("virtualBox->COMGETTER(Version)=%08X\n", rc);536 RTPrintf ("virtualBox->COMGETTER(Version)=%08X\n", rc); 526 537 527 538 { … … 535 546 ComPtr <IMachine> machine; 536 547 rc = session->COMGETTER(Machine)(machine.asOutParam()); 537 printf ("session->COMGETTER(Machine)=%08X\n", rc);548 RTPrintf ("session->COMGETTER(Machine)=%08X\n", rc); 538 549 539 550 // { … … 545 556 SessionState_T state; 546 557 rc = session->COMGETTER(State) (&state); 547 printf ("session->COMGETTER(State)=%08X\n", rc);558 RTPrintf ("session->COMGETTER(State)=%08X\n", rc); 548 559 549 560 { … … 561 572 ComPtr <IHardDisk> hd; 562 573 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()); 564 575 CHECK_ERROR_BREAK (virtualBox, OpenHardDisk (src, AccessMode_ReadWrite, hd.asOutParam())); 565 printf ("Enter to continue...\n");576 RTPrintf ("Enter to continue...\n"); 566 577 getchar(); 567 printf ("Registering the existing hard disk '%ls'...\n", src.raw());578 RTPrintf ("Registering the existing hard disk '%ls'...\n", src.raw()); 568 579 CHECK_ERROR_BREAK (virtualBox, RegisterHardDisk (hd)); 569 printf ("Enter to continue...\n");580 RTPrintf ("Enter to continue...\n"); 570 581 getchar(); 571 582 } 572 583 while (FALSE); 573 printf ("\n");584 RTPrintf ("\n"); 574 585 #endif 575 586 … … 581 592 ComPtr <IVirtualDiskImage> vdi; 582 593 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()); 584 595 CHECK_ERROR_BREAK (virtualBox, FindVirtualDiskImage (src, vdi.asOutParam())); 585 596 ComPtr <IHardDisk> hd = vdi; … … 589 600 } 590 601 while (FALSE); 591 printf ("\n");602 RTPrintf ("\n"); 592 603 #endif 593 604 … … 623 634 } 624 635 while (FALSE); 625 printf ("\n");636 RTPrintf ("\n"); 626 637 #endif 627 638 … … 645 656 }; 646 657 647 printf ("\n");658 RTPrintf ("\n"); 648 659 649 660 for (size_t i = 0; i < RT_ELEMENTS (Names); ++ i) 650 661 { 651 662 Bstr src = Names [i]; 652 printf ("Searching for hard disk '%ls'...\n", src.raw());663 RTPrintf ("Searching for hard disk '%ls'...\n", src.raw()); 653 664 rc = virtualBox->FindHardDisk (src, hd.asOutParam()); 654 665 if (SUCCEEDED (rc)) … … 658 669 CHECK_ERROR_BREAK (hd, COMGETTER(Id) (id.asOutParam())); 659 670 CHECK_ERROR_BREAK (hd, COMGETTER(Location) (location.asOutParam())); 660 printf ("Found, UUID={%Vuuid}, location='%ls'.\n",671 RTPrintf ("Found, UUID={%Vuuid}, location='%ls'.\n", 661 672 id.raw(), location.raw()); 662 673 … … 668 679 ComSafeArrayAsOutParam (values))); 669 680 670 printf ("Properties:\n");681 RTPrintf ("Properties:\n"); 671 682 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]); 673 684 674 685 if (names.size() == 0) 675 printf (" <none>\n");686 RTPrintf (" <none>\n"); 676 687 677 688 #if 0 … … 679 690 Bstr value = Utf8StrFmt ("lalala (%llu)", RTTimeMilliTS()); 680 691 681 printf ("Settings property %ls to %ls...\n", name.raw(), value.raw());692 RTPrintf ("Settings property %ls to %ls...\n", name.raw(), value.raw()); 682 693 CHECK_ERROR (hd, SetProperty (name, value)); 683 694 #endif … … 688 699 PRINT_ERROR_INFO (info); 689 700 } 690 printf ("\n");701 RTPrintf ("\n"); 691 702 } 692 703 } 693 704 while (FALSE); 694 printf ("\n");705 RTPrintf ("\n"); 695 706 #endif 696 707 … … 702 713 ComPtr <IMachine> machine; 703 714 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()); 705 716 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"); 707 718 readAndChangeMachineSettings (machine); 708 719 #if 0 709 720 if (argc != 2) 710 721 { 711 printf ("Error: a string has to be supplied!\n");722 RTPrintf ("Error: a string has to be supplied!\n"); 712 723 } 713 724 else … … 719 730 } 720 731 while (0); 721 printf ("\n");732 RTPrintf ("\n"); 722 733 #endif 723 734 … … 735 746 Bstr name = L"machina"; 736 747 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", 738 749 baseDir.raw(), name.raw()); 739 750 CHECK_ERROR_BREAK (virtualBox, CreateMachine (baseDir, name, 740 751 machine.asOutParam())); 741 752 742 printf ("Getting name...\n");753 RTPrintf ("Getting name...\n"); 743 754 CHECK_ERROR_BREAK (machine, COMGETTER(Name) (name.asOutParam())); 744 printf ("Name: {%ls}\n", name.raw());755 RTPrintf ("Name: {%ls}\n", name.raw()); 745 756 746 757 BOOL modified = FALSE; 747 printf ("Are any settings modified?...\n");758 RTPrintf ("Are any settings modified?...\n"); 748 759 CHECK_ERROR_BREAK (machine, COMGETTER(SettingsModified) (&modified)); 749 printf ("%s\n", modified ? "yes" : "no");760 RTPrintf ("%s\n", modified ? "yes" : "no"); 750 761 751 762 ASSERT_BREAK (modified == TRUE); 752 763 753 764 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()); 755 766 CHECK_ERROR_BREAK (machine, COMSETTER(Name) (name)); 756 767 757 printf ("Setting memory size to 111...\n");768 RTPrintf ("Setting memory size to 111...\n"); 758 769 CHECK_ERROR_BREAK (machine, COMSETTER(MemorySize) (111)); 759 770 760 771 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()); 762 773 CHECK_ERROR_BREAK (machine, COMSETTER(Description) (desc)); 763 774 … … 766 777 CHECK_ERROR_BREAK (virtualBox, GetGuestOSType (type, guestOSType.asOutParam())); 767 778 768 printf ("Saving new machine settings...\n");779 RTPrintf ("Saving new machine settings...\n"); 769 780 CHECK_ERROR_BREAK (machine, SaveSettings()); 770 781 771 printf ("Accessing the newly created machine:\n");782 RTPrintf ("Accessing the newly created machine:\n"); 772 783 readAndChangeMachineSettings (machine); 773 784 } 774 785 while (FALSE); 775 printf ("\n");786 RTPrintf ("\n"); 776 787 #endif 777 788 … … 796 807 Bstr name; 797 808 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()); 799 810 } 800 811 CHECK_RC_BREAK (rc); … … 808 819 Bstr name; 809 820 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()); 811 822 } 812 823 } 813 824 } 814 825 while (FALSE); 815 printf ("\n");826 RTPrintf ("\n"); 816 827 #endif 817 828 … … 905 916 COMGETTER(HardDisks)(ComSafeArrayAsOutParam (disks))); 906 917 907 printf ("%u base hard disks registered (disks.isNull()=%d).\n",918 RTPrintf ("%u base hard disks registered (disks.isNull()=%d).\n", 908 919 disks.size(), disks.isNull()); 909 920 … … 919 930 CHECK_ERROR_BREAK (disks [i], COMGETTER(Format) (format.asOutParam())); 920 931 921 printf (" disks[%u]: '%ls'\n"932 RTPrintf (" disks[%u]: '%ls'\n" 922 933 " UUID: {%Vuuid}\n" 923 934 " State: %s\n" … … 937 948 CHECK_ERROR_BREAK (disks [i], 938 949 COMGETTER(LastAccessError)(error.asOutParam())); 939 printf (" Access Error: %ls\n", error.raw());950 RTPrintf (" Access Error: %ls\n", error.raw()); 940 951 } 941 952 942 953 /* get usage */ 943 954 944 printf (" Used by VMs:\n");955 RTPrintf (" Used by VMs:\n"); 945 956 946 957 com::SafeGUIDArray ids; … … 949 960 if (ids.size() == 0) 950 961 { 951 printf (" <not used>\n");962 RTPrintf (" <not used>\n"); 952 963 } 953 964 else … … 955 966 for (size_t j = 0; j < ids.size(); ++ j) 956 967 { 957 printf (" {%Vuuid}\n", &ids [j]);968 RTPrintf (" {%Vuuid}\n", &ids [j]); 958 969 } 959 970 } … … 965 976 COMGETTER(DVDImages) (ComSafeArrayAsOutParam (images))); 966 977 967 printf ("%u DVD images registered (images.isNull()=%d).\n",978 RTPrintf ("%u DVD images registered (images.isNull()=%d).\n", 968 979 images.size(), images.isNull()); 969 980 … … 977 988 CHECK_ERROR_BREAK (images [i], COMGETTER(State) (&state)); 978 989 979 printf (" images[%u]: '%ls'\n"990 RTPrintf (" images[%u]: '%ls'\n" 980 991 " UUID: {%Vuuid}\n" 981 992 " State: %s\n", … … 993 1004 CHECK_ERROR_BREAK (images [i], 994 1005 COMGETTER(LastAccessError)(error.asOutParam())); 995 printf (" Access Error: %ls\n", error.raw());1006 RTPrintf (" Access Error: %ls\n", error.raw()); 996 1007 } 997 1008 998 1009 /* get usage */ 999 1010 1000 printf (" Used by VMs:\n");1011 RTPrintf (" Used by VMs:\n"); 1001 1012 1002 1013 com::SafeGUIDArray ids; … … 1005 1016 if (ids.size() == 0) 1006 1017 { 1007 printf (" <not used>\n");1018 RTPrintf (" <not used>\n"); 1008 1019 } 1009 1020 else … … 1011 1022 for (size_t j = 0; j < ids.size(); ++ j) 1012 1023 { 1013 printf (" {%Vuuid}\n", &ids [j]);1024 RTPrintf (" {%Vuuid}\n", &ids [j]); 1014 1025 } 1015 1026 } … … 1018 1029 } 1019 1030 while (FALSE); 1020 printf ("\n");1031 RTPrintf ("\n"); 1021 1032 #endif 1022 1033 … … 1028 1039 ComPtr <IMachine> machine; 1029 1040 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()); 1031 1042 CHECK_ERROR_BREAK (virtualBox, FindMachine (name, machine.asOutParam())); 1032 1043 Guid guid; 1033 1044 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"); 1035 1046 CHECK_RC_BREAK (virtualBox->OpenSession (session, guid)); 1036 1047 #if 1 1037 1048 ComPtr <IMachine> sessionMachine; 1038 printf ("Getting sessioned machine object...\n");1049 RTPrintf ("Getting sessioned machine object...\n"); 1039 1050 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"); 1041 1052 readAndChangeMachineSettings (sessionMachine, machine); 1042 1053 #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"); 1045 1056 ComPtr <IVRDPServer> vrdp; 1046 1057 CHECK_ERROR_BREAK (sessionMachine, COMGETTER(VRDPServer) (vrdp.asOutParam())); … … 1053 1064 BOOL enabled = FALSE; 1054 1065 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"); 1056 1067 } 1057 1068 #endif … … 1059 1070 #if 0 1060 1071 ComPtr <IConsole> console; 1061 printf ("Getting the console object...\n");1072 RTPrintf ("Getting the console object...\n"); 1062 1073 CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam())); 1063 printf ("Discarding the current machine state...\n");1074 RTPrintf ("Discarding the current machine state...\n"); 1064 1075 ComPtr <IProgress> progress; 1065 1076 CHECK_ERROR_BREAK (console, DiscardCurrentState (progress.asOutParam())); 1066 printf ("Waiting for completion...\n");1077 RTPrintf ("Waiting for completion...\n"); 1067 1078 CHECK_ERROR_BREAK (progress, WaitForCompletion (-1)); 1068 1079 ProgressErrorInfo ei (progress); … … 1074 1085 CHECK_ERROR_BREAK (progress, COMGETTER(Initiator) (initiator.asOutParam())); 1075 1086 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..."); 1082 1093 getchar(); 1083 1094 session->Close(); 1084 1095 } 1085 1096 while (FALSE); 1086 printf ("\n");1097 RTPrintf ("\n"); 1087 1098 #endif 1088 1099 … … 1094 1105 ComPtr <IMachine> machine; 1095 1106 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()); 1097 1108 CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam())); 1098 1109 Guid guid; 1099 1110 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"); 1101 1112 ComPtr <IProgress> progress; 1102 1113 CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, Bstr("gui"), 1103 1114 NULL, progress.asOutParam())); 1104 printf ("Waiting for the session to open...\n");1115 RTPrintf ("Waiting for the session to open...\n"); 1105 1116 CHECK_RC_BREAK (progress->WaitForCompletion (-1)); 1106 1117 ComPtr <IMachine> sessionMachine; 1107 printf ("Getting sessioned machine object...\n");1118 RTPrintf ("Getting sessioned machine object...\n"); 1108 1119 CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam())); 1109 1120 ComPtr <IConsole> console; 1110 printf ("Getting console object...\n");1121 RTPrintf ("Getting console object...\n"); 1111 1122 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..."); 1113 1124 getchar(); 1114 1125 CHECK_RC (console->Pause()); 1115 printf ("Press enter to close this session...");1126 RTPrintf ("Press enter to close this session..."); 1116 1127 getchar(); 1117 1128 session->Close(); 1118 1129 } 1119 1130 while (FALSE); 1120 printf ("\n");1131 RTPrintf ("\n"); 1121 1132 #endif 1122 1133 … … 1128 1139 ComPtr <IMachine> machine; 1129 1140 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()); 1131 1142 CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam())); 1132 1143 Guid guid; 1133 1144 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"); 1135 1146 CHECK_RC_BREAK (virtualBox->OpenExistingSession (session, guid)); 1136 1147 ComPtr <IMachine> sessionMachine; 1137 printf ("Getting sessioned machine object...\n");1148 RTPrintf ("Getting sessioned machine object...\n"); 1138 1149 CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam())); 1139 1150 … … 1145 1156 #if 0 1146 1157 ComPtr <IConsole> console; 1147 printf ("Getting console object...\n");1158 RTPrintf ("Getting console object...\n"); 1148 1159 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..."); 1150 1161 getchar(); 1151 1162 CHECK_RC (console->Pause()); 1152 printf ("Press enter to close this session...");1163 RTPrintf ("Press enter to close this session..."); 1153 1164 getchar(); 1154 1165 #endif … … 1156 1167 } 1157 1168 while (FALSE); 1158 printf ("\n");1169 RTPrintf ("\n"); 1159 1170 #endif 1160 1171 … … 1167 1178 ULONG uMemSize, uMemAvail; 1168 1179 CHECK_ERROR_BREAK (host, COMGETTER(MemorySize) (&uMemSize)); 1169 printf("Total memory (MB): %u\n", uMemSize);1180 RTPrintf("Total memory (MB): %u\n", uMemSize); 1170 1181 CHECK_ERROR_BREAK (host, COMGETTER(MemoryAvailable) (&uMemAvail)); 1171 printf("Free memory (MB): %u\n", uMemAvail);1182 RTPrintf("Free memory (MB): %u\n", uMemAvail); 1172 1183 } while (0); 1173 1184 #endif … … 1187 1198 Bstr interfaceName; 1188 1199 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()); 1190 1201 Guid interfaceGuid; 1191 1202 networkInterface->COMGETTER(Id)(interfaceGuid.asOutParam()); … … 1197 1208 networkInterface->COMGETTER(Id)(interfaceGuid2.asOutParam()); 1198 1209 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()); 1200 1211 // Find the interface by its guid 1201 1212 networkInterface.setNull(); … … 1205 1216 networkInterface->COMGETTER(Name)(interfaceName2.asOutParam()); 1206 1217 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()); 1208 1219 } 1209 1220 else 1210 1221 { 1211 printf("No network interfaces found!\n");1222 RTPrintf("No network interfaces found!\n"); 1212 1223 } 1213 1224 } while (0); … … 1235 1246 Bstr name = argc > 1 ? argv [1] : "dsl"; 1236 1247 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()); 1238 1249 CHECK_RC_BREAK (virtualBox->FindMachine (name, machine.asOutParam())); 1239 1250 … … 1241 1252 Guid guid; 1242 1253 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"); 1244 1255 ComPtr <IProgress> progress; 1245 1256 CHECK_RC_BREAK (virtualBox->OpenRemoteSession (session, guid, sessionType, 1246 1257 NULL, progress.asOutParam())); 1247 printf ("Waiting for the session to open...\n");1258 RTPrintf ("Waiting for the session to open...\n"); 1248 1259 CHECK_RC_BREAK (progress->WaitForCompletion (-1)); 1249 1260 ComPtr <IMachine> sessionMachine; 1250 printf ("Getting sessioned machine object...\n");1261 RTPrintf ("Getting sessioned machine object...\n"); 1251 1262 CHECK_RC_BREAK (session->COMGETTER(Machine) (sessionMachine.asOutParam())); 1252 1263 … … 1266 1277 // Get console 1267 1278 ComPtr <IConsole> console; 1268 printf ("Getting console object...\n");1279 RTPrintf ("Getting console object...\n"); 1269 1280 CHECK_RC_BREAK (session->COMGETTER(Console) (console.asOutParam())); 1270 1281 1271 1282 RTThreadSleep(5000); // Sleep for 5 seconds 1272 1283 1273 printf("\nMetrics collected with VM running: --------------------\n");1284 RTPrintf("\nMetrics collected with VM running: --------------------\n"); 1274 1285 queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects)); 1275 1286 1276 1287 // 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..."); 1278 1289 //getchar(); 1279 1290 CHECK_RC (console->Pause()); … … 1281 1292 RTThreadSleep(5000); // Sleep for 5 seconds 1282 1293 1283 printf("\nMetrics collected with VM paused: ---------------------\n");1294 RTPrintf("\nMetrics collected with VM paused: ---------------------\n"); 1284 1295 queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects)); 1285 1296 1286 printf("\nDrop collected metrics: ----------------------------------------\n");1297 RTPrintf("\nDrop collected metrics: ----------------------------------------\n"); 1287 1298 CHECK_ERROR_BREAK (collector, 1288 1299 SetupMetrics(ComSafeArrayAsInParam(baseMetrics), … … 1297 1308 machine.queryInterfaceTo(&vmObject[0]); 1298 1309 1299 printf("\nDisable collection of VM metrics: ------------------------------\n");1310 RTPrintf("\nDisable collection of VM metrics: ------------------------------\n"); 1300 1311 CHECK_ERROR_BREAK (collector, 1301 1312 DisableMetrics(ComSafeArrayAsInParam(baseMetrics), … … 1308 1319 queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects)); 1309 1320 1310 printf("\nRe-enable collection of all metrics: ---------------------------\n");1321 RTPrintf("\nRe-enable collection of all metrics: ---------------------------\n"); 1311 1322 CHECK_ERROR_BREAK (collector, 1312 1323 EnableMetrics(ComSafeArrayAsInParam(baseMetrics), … … 1320 1331 1321 1332 // Power off 1322 printf ("Press enter to power off VM...");1333 RTPrintf ("Press enter to power off VM..."); 1323 1334 getchar(); 1324 1335 CHECK_RC (console->PowerDown()); 1325 printf ("Press enter to close this session...");1336 RTPrintf ("Press enter to close this session..."); 1326 1337 getchar(); 1327 1338 session->Close(); … … 1356 1367 RTPrintf ("Disks:"); 1357 1368 for (unsigned i = 0; i < retDisks.size(); i++) 1358 printf (" %ls", Bstr (retDisks [i]).raw());1369 RTPrintf (" %ls", Bstr (retDisks [i]).raw()); 1359 1370 RTPrintf ("\n"); 1360 1371 } … … 1382 1393 for (unsigned a = 0; a < retTypes.size(); ++a) 1383 1394 { 1384 printf (" %d %ls %ls %ls\n",1395 RTPrintf (" %d %ls %ls %ls\n", 1385 1396 retTypes [a], 1386 1397 Bstr (retOrigValues [a]).raw(), … … 1424 1435 } 1425 1436 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..."); 1430 1441 getchar(); 1431 1442 … … 1435 1446 while (0); 1436 1447 1437 printf("Press enter to shutdown COM...");1448 RTPrintf("Press enter to shutdown COM..."); 1438 1449 getchar(); 1439 1450 1440 1451 com::Shutdown(); 1441 1452 1442 printf ("tstAPI FINISHED.\n");1453 RTPrintf ("tstAPI FINISHED.\n"); 1443 1454 1444 1455 return rc; -
trunk/src/VBox/Main/webservice/samples/perl/clienttest.pl
r20827 r20928 39 39 my $optMode; 40 40 my $vmname; 41 my $disk; 41 42 42 43 while (my $this = shift(@ARGV)) … … 66 67 { 67 68 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"; 68 78 } 69 79 } … … 148 158 vboxService->IWebsessionManager_logoff($vbox); 149 159 } 160 elsif ($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 26 26 #include <VBox/com/Guid.h> 27 27 #include <VBox/com/ErrorInfo.h> 28 #include <VBox/com/errorprint 2.h>28 #include <VBox/com/errorprint.h> 29 29 #include <VBox/com/EventQueue.h> 30 30 #include <VBox/com/VirtualBox.h> -
trunk/src/VBox/Main/webservice/websrv-cpp.xsl
r20888 r20928 10 10 all SOAP calls into COM/XPCOM method calls. 11 11 12 Copyright (C) 2006-200 8Sun Microsystems, Inc.12 Copyright (C) 2006-2009 Sun Microsystems, Inc. 13 13 14 14 This file is part of VirtualBox Open Source Edition (OSE), as … … 66 66 #include <VBox/com/Guid.h> 67 67 #include <VBox/com/ErrorInfo.h> 68 #include <VBox/com/errorprint 2.h>68 #include <VBox/com/errorprint.h> 69 69 #include <VBox/com/EventQueue.h> 70 70 #include <VBox/com/VirtualBox.h>
Note:
See TracChangeset
for help on using the changeset viewer.