儲存庫 vbox 的更動 17192
- 時間撮記:
- 2009-2-27 上午09:17:19 (16 年 以前)
- 位置:
- trunk/src/VBox
- 檔案:
-
- 修改 14 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r17104 r17192 671 671 ComPtr<IHost> host; 672 672 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 673 ComPtr<IHostDVDDriveCollection> hostDVDs; 674 CHECK_ERROR(host, COMGETTER(DVDDrives)(hostDVDs.asOutParam())); 673 com::SafeIfaceArray <IHostDVDDrive> hostDVDs; 674 rc = host->COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(hostDVDs)); 675 675 676 ComPtr<IHostDVDDrive> hostDVDDrive; 676 rc = host DVDs->FindByName(Bstr(a->argv[2] + 5), hostDVDDrive.asOutParam());677 rc = host->FindHostDVDDrive(Bstr(a->argv[2] + 5), hostDVDDrive.asOutParam()); 677 678 if (!hostDVDDrive) 678 679 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r17091 r17192 224 224 { 225 225 /* 226 * Iterate through the collection.227 */226 * Iterate through the collection. 227 */ 228 228 for (size_t i = 0; i < coll.size(); ++ i) 229 229 { … … 245 245 ComPtr<IHost> host; 246 246 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 247 ComPtr<IHostDVDDriveCollection> coll; 248 ComPtr<IHostDVDDriveEnumerator> enumerator; 249 CHECK_ERROR(host, COMGETTER(DVDDrives)(coll.asOutParam())); 250 if (SUCCEEDED(rc) && coll) 251 { 252 CHECK_ERROR(coll, Enumerate(enumerator.asOutParam())); 253 BOOL hasMore; 254 while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore) 255 { 256 ComPtr<IHostDVDDrive> dvdDrive; 257 CHECK_ERROR_BREAK(enumerator, GetNext(dvdDrive.asOutParam())); 247 com::SafeIfaceArray <IHostDVDDrive> coll; 248 CHECK_ERROR(host, COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(coll))); 249 if (SUCCEEDED(rc)) 250 { 251 for (size_t i = 0; i < coll.size(); ++ i) 252 { 253 ComPtr<IHostDVDDrive> dvdDrive = coll[i]; 258 254 Bstr name; 259 255 dvdDrive->COMGETTER(Name)(name.asOutParam()); … … 779 775 780 776 #endif /* !VBOX_ONLY_DOCS */ 781 777 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r16960 r17192 25 25 #ifndef VBOX_ONLY_DOCS 26 26 #include <VBox/com/com.h> 27 #include <VBox/com/array.h> 27 28 #include <VBox/com/ErrorInfo.h> 28 29 #include <VBox/com/errorprint2.h> … … 1091 1092 ComPtr<IHost> host; 1092 1093 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 1093 ComPtr<IHostDVDDriveCollection> hostDVDs; 1094 CHECK_ERROR(host, COMGETTER(DVDDrives)(hostDVDs.asOutParam())); 1094 com::SafeIfaceArray <IHostDVDDrive> hostDVDs; 1095 rc = host->COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(hostDVDs)); 1096 1095 1097 ComPtr<IHostDVDDrive> hostDVDDrive; 1096 rc = host DVDs->FindByName(Bstr(dvd + 5), hostDVDDrive.asOutParam());1098 rc = host->FindHostDVDDrive(Bstr(dvd + 5), hostDVDDrive.asOutParam()); 1097 1099 if (!hostDVDDrive) 1098 1100 { … … 1105 1107 break; 1106 1108 } 1107 rc = host DVDs->FindByName(Bstr(szPathReal), hostDVDDrive.asOutParam());1109 rc = host->FindHostDVDDrive(Bstr(szPathReal), hostDVDDrive.asOutParam()); 1108 1110 if (!hostDVDDrive) 1109 1111 { -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r16867 r17192 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 … … 1772 1772 ComPtr <IHost> host; 1773 1773 CHECK_ERROR_BREAK (virtualBox, COMGETTER(Host)(host.asOutParam())); 1774 ComPtr <IHostDVDDriveCollection> coll;1775 CHECK_ERROR_BREAK (host, COMGETTER(DVDDrives)( coll.asOutParam()));1774 SafeIfaceArray <IHostDVDDrive> coll; 1775 CHECK_ERROR_BREAK (host, COMGETTER(DVDDrives)(ComSafeArrayAsOutParam(coll))); 1776 1776 ComPtr <IHostDVDDrive> hostDrive; 1777 rc = coll->FindByName (medium, hostDrive.asOutParam());1777 rc = host->FindHostDVDDrive (medium, hostDrive.asOutParam()); 1778 1778 if (SUCCEEDED (rc)) 1779 1779 { -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r17175 r17192 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 3133 3133 3134 3134 hostDVDMap.clear(); 3135 CHostDVDDrive Enumerator en=3136 vboxGlobal().virtualBox().GetHost().GetDVDDrives() .Enumerate();3137 while (en.HasMore())3138 { 3139 CHostDVDDrive hostDVD = en.GetNext();3135 CHostDVDDriveVector drvvec = 3136 vboxGlobal().virtualBox().GetHost().GetDVDDrives(); 3137 for (int i = 0; i < drvvec.size(); ++i) 3138 { 3139 CHostDVDDrive hostDVD = drvvec[i]; 3140 3140 /** @todo set icon */ 3141 3141 QString drvName = hostDVD.GetName(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMFirstRunWzd.cpp
r16867 r17192 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 176 176 { 177 177 /* Search for the host dvd-drives */ 178 CHostDVDDrive Collectioncoll =178 CHostDVDDriveVector coll = 179 179 vboxGlobal().virtualBox().GetHost().GetDVDDrives(); 180 mHostDVDs.resize (coll.GetCount()); 181 int id = 0; 182 CHostDVDDriveEnumerator en = coll.Enumerate(); 183 while (en.HasMore()) 184 { 185 CHostDVDDrive hostDVD = en.GetNext(); 180 mHostDVDs.resize (coll.size()); 181 182 for (int id = 0; id < coll.size(); ++id) 183 { 184 CHostDVDDrive hostDVD = coll[id]; 186 185 QString name = hostDVD.GetName(); 187 186 QString description = hostDVD.GetDescription(); … … 190 189 mCbHost->insertItem (id, fullName); 191 190 mHostDVDs [id] = hostDVD; 192 ++ id;193 191 } 194 192 … … 222 220 223 221 /* Repopulate the media list */ 224 222 mCbImage->repopulate(); 225 223 226 224 /* Revalidate updated page */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsCD.cpp
r16853 r17192 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 59 59 60 60 /* Read out the host DVD drive list and prepare the combobox */ 61 CHostDVDDrive Collectioncoll =61 CHostDVDDriveVector coll = 62 62 vboxGlobal().virtualBox().GetHost().GetDVDDrives(); 63 mHostCDs.resize (coll. GetCount());63 mHostCDs.resize (coll.size()); 64 64 mCbHostCD->clear(); 65 int id = 0; 66 CHostDVDDriveEnumerator en = coll.Enumerate(); 67 while (en.HasMore()) 68 { 69 CHostDVDDrive hostDVD = en.GetNext(); 65 66 for (int id = 0; id < coll.size(); ++id) 67 { 68 CHostDVDDrive hostDVD = coll[id]; 70 69 /// @todo (r=dmik) set icon? 71 70 QString name = hostDVD.GetName(); … … 75 74 mCbHostCD->insertItem (id, fullName); 76 75 mHostCDs [id] = hostDVD; 77 ++ id;78 76 } 79 77 … … 89 87 name : 90 88 QString ("%1 (%2)").arg (description, name); 91 if ( coll.FindByName (name).isNull())89 if (vboxGlobal().virtualBox().GetHost().FindHostDVDDrive (name).isNull()) 92 90 { 93 91 /* If the DVD drive is not currently available, -
trunk/src/VBox/Main/DVDDriveImpl.cpp
r16853 r17192 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 … … 452 452 Bstr src = typeNode.stringValue ("src"); 453 453 454 /* find the correspo ding object */454 /* find the corresponding object */ 455 455 ComObjPtr <Host> host = mParent->virtualBox()->host(); 456 456 457 ComPtr <IHostDVDDriveCollection> coll;458 rc = host->COMGETTER(DVDDrives) ( coll.asOutParam());457 com::SafeIfaceArray <IHostDVDDrive> coll; 458 rc = host->COMGETTER(DVDDrives) (ComSafeArrayAsOutParam(coll)); 459 459 AssertComRC (rc); 460 460 461 461 ComPtr <IHostDVDDrive> drive; 462 rc = coll->FindByName (src, drive.asOutParam()); 462 rc = host->FindHostDVDDrive (src, drive.asOutParam()); 463 463 464 if (SUCCEEDED (rc)) 464 465 { -
trunk/src/VBox/Main/HostImpl.cpp
r16967 r17192 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 … … 291 291 * @param drives address of result pointer 292 292 */ 293 STDMETHODIMP Host::COMGETTER(DVDDrives) ( IHostDVDDriveCollection **aDrives)294 { 295 CheckComArgOut PointerValid(aDrives);293 STDMETHODIMP Host::COMGETTER(DVDDrives) (ComSafeArrayOut (IHostDVDDrive *, aDrives)) 294 { 295 CheckComArgOutSafeArrayPointerValid(aDrives); 296 296 AutoWriteLock alock (this); 297 297 CHECK_READY(); … … 399 399 #endif 400 400 401 ComObjPtr<HostDVDDriveCollection> collection; 402 collection.createObject(); 403 collection->init (list); 404 collection.queryInterfaceTo(aDrives); 401 SafeIfaceArray <IHostDVDDrive> array (list); 402 array.detachTo(ComSafeArrayOutArg(aDrives)); 405 403 return rc; 406 404 } … … 3323 3321 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 3324 3322 3323 STDMETHODIMP Host::FindHostDVDDrive(IN_BSTR aName, IHostDVDDrive **aDrive) 3324 { 3325 CheckComArgNotNull(aName); 3326 CheckComArgOutPointerValid(aDrive); 3327 AutoReadLock alock (this); 3328 3329 *aDrive = NULL; 3330 3331 for (DriveInfoList::const_iterator it = mHostDrives.DVDBegin(); 3332 it != mHostDrives.DVDEnd(); ++it) 3333 { 3334 Bstr device (it->mDevice.c_str()); 3335 if (device == aName) 3336 { 3337 ComObjPtr<HostDVDDrive> found; 3338 HRESULT rc = found.createObject(); 3339 CheckComRCReturnRC (rc); 3340 rc = found->init (device, Bstr (it->mUdi.c_str()), Bstr (it->mDescription.c_str())); 3341 CheckComRCReturnRC (rc); 3342 return found.queryInterfaceTo (aDrive); 3343 } 3344 } 3345 3346 return setError (VBOX_E_OBJECT_NOT_FOUND, HostDVDDrive::tr ( 3347 "The host DVD drive named '%ls' could not be found"), aName); 3348 } 3349 3325 3350 STDMETHODIMP Host::FindHostNetworkInterfaceByName(IN_BSTR name, IHostNetworkInterface **networkInterface) 3326 3351 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r17099 r17192 6341 6341 </interface> 6342 6342 6343 <enumerator6344 name="IHostDVDDriveEnumerator" type="IHostDVDDrive"6345 uuid="1ed7cfaf-c363-40df-aa4e-89c1afb7d96b"6346 />6347 6348 <collection6349 name="IHostDVDDriveCollection" type="IHostDVDDrive"6350 enumerator="IHostDVDDriveEnumerator"6351 uuid="1909c533-1a1e-445f-a4e1-a267cffc30ed"6352 readonly="yes"6353 >6354 <method name="findByName">6355 <desc>6356 Searches this collection for a host drive with the given name.6357 <note>6358 The method returns an error if the given name does not6359 correspond to any host drive in the collection.6360 </note>6361 </desc>6362 <param name="name" type="wstring" dir="in">6363 <desc>Name of the host drive to search for</desc>6364 </param>6365 <param name="drive" type="IHostDVDDrive" dir="return">6366 <desc>Found host drive object</desc>6367 </param>6368 </method>6369 </collection>6370 6371 6343 <interface 6372 6344 name="IHostFloppyDrive" extends="$unknown" … … 6543 6515 <interface 6544 6516 name="IHost" extends="$unknown" 6545 uuid=" 7c172c42-b209-4bdc-9ddf-a84f222bd59a"6517 uuid="ba0cb246-478a-4a2b-930e-51ce740ada9c" 6546 6518 wsmap="managed" 6547 6519 > … … 6558 6530 6559 6531 </desc> 6560 <attribute name="DVDDrives" type="IHostDVDDrive Collection" readonly="yes">6532 <attribute name="DVDDrives" type="IHostDVDDrive" readonly="yes" safearray="yes"> 6561 6533 <desc>List of DVD drives available on the host.</desc> 6562 6534 </attribute> … … 6833 6805 </method> 6834 6806 6807 <method name="findHostDVDDrive"> 6808 <desc> 6809 Searches for a host DVD drive with the given @c name. 6810 6811 <result name="VBOX_E_OBJECT_NOT_FOUND"> 6812 Given @c name does not correspond to any host drive. 6813 </result> 6814 6815 </desc> 6816 <param name="name" type="wstring" dir="in"> 6817 <desc>Name of the host drive to search for</desc> 6818 </param> 6819 <param name="drive" type="IHostDVDDrive" dir="return"> 6820 <desc>Found host drive object</desc> 6821 </param> 6822 </method> 6823 6835 6824 <method name="findHostNetworkInterfaceByName"> 6836 6825 <desc> 6837 6826 Searches through all host network interfaces for an interface with 6838 the given name.6839 <note> 6840 The method returns an error if the given name does not6827 the given @c name. 6828 <note> 6829 The method returns an error if the given @c name does not 6841 6830 correspond to any host network interface. 6842 6831 </note> -
trunk/src/VBox/Main/include/HostDVDDriveImpl.h
r15051 r17192 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 … … 24 24 25 25 #include "VirtualBoxBase.h" 26 #include "Collection.h"27 26 28 27 class ATL_NO_VTABLE HostDVDDrive : … … 83 82 }; 84 83 85 COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostDVDDrive)86 87 STDMETHOD(FindByName) (IN_BSTR aName, IHostDVDDrive **aDrive)88 {89 if (!aName)90 return E_INVALIDARG;91 if (!aDrive)92 return E_POINTER;93 94 *aDrive = NULL;95 Vector::value_type found;96 Vector::iterator it = vec.begin();97 while (it != vec.end() && !found)98 {99 Bstr n;100 (*it)->COMGETTER(Name) (n.asOutParam());101 if (n == aName)102 found = *it;103 ++ it;104 }105 106 if (!found)107 return setError (E_INVALIDARG, HostDVDDriveCollection::tr (108 "The host DVD drive named '%ls' could not be found"), aName);109 110 return found.queryInterfaceTo (aDrive);111 }112 113 COM_DECL_READONLY_ENUM_AND_COLLECTION_END (HostDVDDrive)114 115 84 #endif // ____H_HOSTDVDDRIVEIMPL 116 85 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/include/HostImpl.h
r16967 r17192 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 … … 81 81 82 82 // IHost properties 83 STDMETHOD(COMGETTER(DVDDrives))( IHostDVDDriveCollection **drives);83 STDMETHOD(COMGETTER(DVDDrives))(ComSafeArrayOut (IHostDVDDrive*, drives)); 84 84 STDMETHOD(COMGETTER(FloppyDrives))(IHostFloppyDriveCollection **drives); 85 85 STDMETHOD(COMGETTER(USBDevices))(IHostUSBDeviceCollection **aUSBDevices); … … 111 111 STDMETHOD(RemoveUSBDeviceFilter) (ULONG aPosition, IHostUSBDeviceFilter **aFilter); 112 112 113 STDMETHOD(FindHostDVDDrive) (IN_BSTR aName, IHostDVDDrive **aDrive); 113 114 STDMETHOD(FindHostNetworkInterfaceByName) (IN_BSTR aName, IHostNetworkInterface **networkInterface); 114 115 STDMETHOD(FindHostNetworkInterfaceById) (IN_GUID id, IHostNetworkInterface **networkInterface); -
trunk/src/VBox/Main/webservice/webtest.cpp
r16122 r17192 4 4 * functionality of VBoxManage for testing purposes. 5 5 * 6 * Copyright (C) 2006-200 7Sun Microsystems, Inc.6 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 233 233 { 234 234 unsigned int i, 235 c = resp.returnval ->array.size();235 c = resp.returnval.size(); 236 236 for(i = 0; 237 237 i < c; 238 238 ++i) 239 239 { 240 std::cout << "DVD drive " << i << ": objref " << resp.returnval ->array[i] << "\n";240 std::cout << "DVD drive " << i << ": objref " << resp.returnval[i] << "\n"; 241 241 } 242 242 } -
trunk/src/VBox/Main/xpcom/server.cpp
r16971 r17192 243 243 244 244 COM_IMPL_READONLY_ENUM_AND_COLLECTION(Snapshot) 245 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive)246 245 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive) 247 246 #ifdef VBOX_WITH_USB
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器