Changeset 44503 in vbox for trunk/src/VBox/Main/src-server/MediumFormatImpl.cpp
- Timestamp:
- Feb 1, 2013 6:28:53 AM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83539
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.