Changeset 30938 in vbox
- Timestamp:
- Jul 20, 2010 5:32:27 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r30929 r30938 1310 1310 1311 1311 ComObjPtr<Machine> machine; 1312 HRESULT rc = findMachine(Guid(aId), true /* setError */, &machine); 1312 HRESULT rc = findMachine(Guid(aId), 1313 true /* fPermitInaccessible */, 1314 true /* setError */, 1315 &machine); 1313 1316 1314 1317 /* the below will set *aMachine to NULL if machine is null */ … … 1381 1384 // find machine from the given ID 1382 1385 ComObjPtr<Machine> pMachine; 1383 HRESULT rc = findMachine(id, true /* setError */, &pMachine); 1386 HRESULT rc = findMachine(id, 1387 true /* fPermitInaccessible */, 1388 true /* setError */, 1389 &pMachine); 1384 1390 if (FAILED(rc)) return rc; 1385 1391 … … 1949 1955 ComObjPtr<Machine> machine; 1950 1956 1951 HRESULT rc = findMachine(id, true /* setError */, &machine); 1957 HRESULT rc = findMachine(id, 1958 false /* fPermitInaccessible */, 1959 true /* setError */, 1960 &machine); 1952 1961 if (FAILED(rc)) return rc; 1953 1962 … … 2005 2014 ComObjPtr<Machine> machine; 2006 2015 2007 HRESULT rc = findMachine(id, true /* setError */, &machine); 2016 HRESULT rc = findMachine(id, 2017 false /* fPermitInaccessible */, 2018 true /* setError */, 2019 &machine); 2008 2020 if (FAILED(rc)) return rc; 2009 2021 … … 2071 2083 ComObjPtr<Machine> machine; 2072 2084 2073 HRESULT rc = findMachine(id, true /* setError */, &machine); 2085 HRESULT rc = findMachine(id, 2086 false /* fPermitInaccessible */, 2087 true /* setError */, 2088 &machine); 2074 2089 if (FAILED(rc)) return rc; 2075 2090 … … 2842 2857 2843 2858 /** 2844 * Searches for a Machine object with the given ID in the collection2859 * Searches for a machine object with the given ID in the collection 2845 2860 * of registered machines. 2846 2861 * 2847 * @param id 2848 * ID of the machine 2849 * @param doSetError 2850 * if TRUE, the appropriate error info is set in case when the machine 2851 * is not found 2852 * @param machine 2853 * where to store the found machine object (can be NULL) 2854 * 2855 * @return 2856 * S_OK when found or VBOX_E_OBJECT_NOT_FOUND when not found 2857 * 2858 * @note Locks this object for reading. 2862 * @param aId Machine UUID to look for. 2863 * @param aPermitInaccessible If true, inaccessible machines will be found; 2864 * if false, this will fail if the given machine is inaccessible. 2865 * @param aSetError If true, set errorinfo if the machine is not found. 2866 * @param aMachine Returned machine, if found. 2867 * @return 2859 2868 */ 2860 2869 HRESULT VirtualBox::findMachine(const Guid &aId, 2870 bool fPermitInaccessible, 2861 2871 bool aSetError, 2862 2872 ComObjPtr<Machine> *aMachine /* = NULL */) … … 2875 2885 { 2876 2886 ComObjPtr<Machine> pMachine2 = *it; 2877 AutoCaller machCaller(pMachine2); 2878 /* skip inaccessible machines */ 2879 if (FAILED(machCaller.rc())) 2880 continue; 2887 2888 if (!fPermitInaccessible) 2889 { 2890 // skip inaccessible machines 2891 AutoCaller machCaller(pMachine2); 2892 if (FAILED(machCaller.rc())) 2893 continue; 2894 } 2881 2895 2882 2896 if (pMachine2->getId() == aId) … … 3555 3569 { 3556 3570 ComObjPtr<Machine> pMachine; 3557 rc = findMachine(aMachine->getId(), false /* aDoSetError */, &pMachine); 3571 rc = findMachine(aMachine->getId(), 3572 true /* fPermitInaccessible */, 3573 false /* aDoSetError */, 3574 &pMachine); 3558 3575 if (SUCCEEDED(rc)) 3559 3576 { -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r30929 r30938 227 227 } 228 228 229 HRESULT findMachine (const Guid &aId, bool aSetError, 229 HRESULT findMachine (const Guid &aId, 230 bool fPermitInaccessible, 231 bool aSetError, 230 232 ComObjPtr<Machine> *machine = NULL); 231 233
Note:
See TracChangeset
for help on using the changeset viewer.