Changeset 44503 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 1, 2013 6:28:53 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83539
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r44365 r44503 1835 1835 /* Check the capabilities. We need create capabilities. */ 1836 1836 ULONG lCabs = 0; 1837 rc = trgFormat->COMGETTER(Capabilities)(&lCabs); 1837 com::SafeArray <MediumFormatCapabilities_T> mediumFormatCap; 1838 rc = trgFormat->COMGETTER(Capabilities)(ComSafeArrayAsOutParam(mediumFormatCap)); 1839 1838 1840 if (FAILED(rc)) throw rc; 1841 else 1842 { 1843 for (ULONG j = 0; j < mediumFormatCap.size(); j++) 1844 lCabs |= mediumFormatCap[j]; 1845 } 1846 1839 1847 if (!( ((lCabs & MediumFormatCapabilities_CreateFixed) == MediumFormatCapabilities_CreateFixed) 1840 1848 || ((lCabs & MediumFormatCapabilities_CreateDynamic) == MediumFormatCapabilities_CreateDynamic))) -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r44480 r44503 1090 1090 rc = pMedium->COMGETTER(MediumFormat)(pSrcFormat.asOutParam()); 1091 1091 ULONG uSrcCaps = 0; 1092 rc = pSrcFormat->COMGETTER(Capabilities)(&uSrcCaps); 1092 com::SafeArray <MediumFormatCapabilities_T> mediumFormatCap; 1093 rc = pSrcFormat->COMGETTER(Capabilities)(ComSafeArrayAsOutParam(mediumFormatCap)); 1094 1093 1095 if (FAILED(rc)) throw rc; 1096 else 1097 { 1098 for (ULONG j = 0; j < mediumFormatCap.size(); j++) 1099 uSrcCaps |= mediumFormatCap[j]; 1100 } 1094 1101 1095 1102 /* Default format? */ -
trunk/src/VBox/Main/src-server/MediumFormatImpl.cpp
r37587 r44503 218 218 } 219 219 220 STDMETHODIMP MediumFormat::COMGETTER(Capabilities)(ULONG *aCaps) 221 { 222 CheckComArgOutPointerValid(aCaps); 223 224 AutoCaller autoCaller(this); 225 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 226 227 /* m.capabilities is const, no need to lock */ 228 229 /// @todo add COMGETTER(ExtendedCapabilities) when we reach the 32 bit 230 /// limit (or make the argument ULONG64 after checking that COM is capable 231 /// of defining enums (used to represent bit flags) that contain 64-bit 232 /// values). Or go away from the enum/ulong hack for bit sets and use 233 /// a safearray like elsewhere. 234 ComAssertRet((uint64_t)m.capabilities == ((ULONG)m.capabilities), E_FAIL); 235 236 *aCaps = (ULONG)m.capabilities; 220 STDMETHODIMP MediumFormat::COMGETTER(Capabilities)(ComSafeArrayOut(MediumFormatCapabilities_T, aCaps)) 221 { 222 CheckComArgOutSafeArrayPointerValid(aCaps); 223 224 AutoCaller autoCaller(this); 225 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 226 227 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 228 229 SafeArray<MediumFormatCapabilities_T> capabilities(sizeof(MediumFormatCapabilities_T)*8); 230 231 for (ULONG i = 0; i < capabilities.size(); ++i) 232 { 233 ULONG temp = m.capabilities; 234 temp &= 1<<i; 235 capabilities [i] = (MediumFormatCapabilities_T)temp; 236 } 237 238 capabilities.detachTo(ComSafeArrayOutArg(aCaps)); 237 239 238 240 return S_OK; -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r44406 r44503 2536 2536 throw rc; 2537 2537 ULONG uTargetCaps = 0; 2538 rc = pTargetFormat->COMGETTER(Capabilities)(&uTargetCaps); 2539 if (FAILED(rc)) 2540 throw rc; 2538 com::SafeArray <MediumFormatCapabilities_T> mediumFormatCap; 2539 rc = pTargetFormat->COMGETTER(Capabilities)(ComSafeArrayAsOutParam(mediumFormatCap)); 2540 2541 if (FAILED(rc)) throw rc; 2542 else 2543 { 2544 for (ULONG j = 0; j < mediumFormatCap.size(); j++) 2545 uTargetCaps |= mediumFormatCap[j]; 2546 } 2541 2547 2542 2548 if (uTargetCaps & MediumFormatCapabilities_File)
Note:
See TracChangeset
for help on using the changeset viewer.