这篇教程C++ ComAssertRet函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ComAssertRet函数的典型用法代码示例。如果您正苦于以下问题:C++ ComAssertRet函数的具体用法?C++ ComAssertRet怎么用?C++ ComAssertRet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ComAssertRet函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: adepHRESULT USBDeviceFilters::insertDeviceFilter(ULONG aPosition, const ComPtr<IUSBDeviceFilter> &aFilter){#ifdef VBOX_WITH_USB /* the machine needs to be mutable */ AutoMutableStateDependency adep(m->pParent); if (FAILED(adep.rc())) return adep.rc(); AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); IUSBDeviceFilter *iFilter = aFilter; ComObjPtr<USBDeviceFilter> pFilter = static_cast<USBDeviceFilter*>(iFilter); if (pFilter->mInList) return setError(VBOX_E_INVALID_OBJECT_STATE, tr("The given USB device pFilter is already in the list")); /* backup the list before modification */ m->llDeviceFilters.backup(); /* iterate to the position... */ DeviceFilterList::iterator it; if (aPosition < m->llDeviceFilters->size()) { it = m->llDeviceFilters->begin(); std::advance(it, aPosition); } else it = m->llDeviceFilters->end(); /* ...and insert */ m->llDeviceFilters->insert(it, pFilter); pFilter->mInList = true; /* notify the proxy (only when it makes sense) */ if (pFilter->i_getData().mActive && Global::IsOnline(adep.machineState()) && pFilter->i_getData().mRemote.isMatch(false)) { USBProxyService *pProxySvc = m->pHost->i_usbProxyService(); ComAssertRet(pProxySvc, E_FAIL); ComAssertRet(pFilter->i_getId() == NULL, E_FAIL); pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter); } alock.release(); AutoWriteLock mlock(m->pParent COMMA_LOCKVAL_SRC_POS); m->pParent->i_setModified(Machine::IsModified_USB); mlock.release(); return S_OK;#else /* VBOX_WITH_USB */ NOREF(aPosition); NOREF(aFilter); ReturnComNotImplemented();#endif /* VBOX_WITH_USB */}
开发者ID:mcenirm,项目名称:vbox,代码行数:60,
示例2: autoCaller/** * Called by setter methods of all USB device filters. * * @note Locks nothing. */HRESULT USBController::onDeviceFilterChange (USBDeviceFilter *aFilter, BOOL aActiveChanged /* = FALSE */){ AutoCaller autoCaller(this); AssertComRCReturnRC(autoCaller.rc()); /* we need the machine state */ AutoAnyStateDependency adep(m->pParent); AssertComRCReturnRC(adep.rc()); /* nothing to do if the machine isn't running */ if (!Global::IsOnline (adep.machineState())) return S_OK; /* we don't modify our data fields -- no need to lock */ if ( aFilter->mInList && m->pParent->isRegistered()) { USBProxyService *service = m->pHost->usbProxyService(); ComAssertRet(service, E_FAIL); if (aActiveChanged) { if (aFilter->getData().mRemote.isMatch (false)) { /* insert/remove the filter from the proxy */ if (aFilter->getData().mActive) { ComAssertRet(aFilter->getId() == NULL, E_FAIL); aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); } else { ComAssertRet(aFilter->getId() != NULL, E_FAIL); service->removeFilter(aFilter->getId()); aFilter->getId() = NULL; } } } else { if (aFilter->getData().mActive) { /* update the filter in the proxy */ ComAssertRet(aFilter->getId() != NULL, E_FAIL); service->removeFilter(aFilter->getId()); if (aFilter->getData().mRemote.isMatch (false)) { aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); } } } } return S_OK;}
开发者ID:virendramishra,项目名称:VirtualBox4.1.18,代码行数:62,
示例3: LogFlowThisFunc/** * Initializes the audio adapter object. * * @param aParent Handle of the parent object. */HRESULT AudioAdapter::init (Machine *aParent){ LogFlowThisFunc(("aParent=%p/n", aParent)); ComAssertRet(aParent, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); /* Get the default audio driver out of the system properties */ ComPtr<IVirtualBox> VBox; HRESULT rc = aParent->COMGETTER(Parent)(VBox.asOutParam()); if (FAILED(rc)) return rc; ComPtr<ISystemProperties> sysProps; rc = VBox->COMGETTER(SystemProperties)(sysProps.asOutParam()); if (FAILED(rc)) return rc; AudioDriverType_T defaultAudioDriver; rc = sysProps->COMGETTER(DefaultAudioDriver)(&defaultAudioDriver); if (FAILED(rc)) return rc; unconst(mParent) = aParent; /* mPeer is left null */ mData.allocate(); mData->mAudioDriver = defaultAudioDriver; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:MadHacker217,项目名称:VirtualBox-OSE,代码行数:37,
示例4: adepHRESULT USBDeviceFilter::setRemote(const com::Utf8Str &aRemote){ /* the machine needs to be mutable */ AutoMutableOrSavedOrRunningStateDependency adep(mParent->i_getMachine()); if (FAILED(adep.rc())) return adep.rc(); AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); Bstr bRemote = Bstr(aRemote).raw(); if (bd->mRemote.string() != bRemote) { BackupableUSBDeviceFilterData::BOOLFilter flt = bRemote; ComAssertRet(!flt.isNull(), E_FAIL); if (!flt.isValid()) return setError(E_INVALIDARG, tr("Remote state filter string '%s' is not valid (error at position %d)"), aRemote.c_str(), flt.errorPosition() + 1); m_fModified = true; ComObjPtr<Machine> pMachine = mParent->i_getMachine(); bd.backup(); bd->mRemote = flt; // leave the lock before informing callbacks alock.release(); AutoWriteLock mlock(pMachine COMMA_LOCKVAL_SRC_POS); pMachine->i_setModified(Machine::IsModified_USB); mlock.release(); return mParent->i_onDeviceFilterChange(this); } return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:34,
示例5: LogFlowThisFunc/** * Initializes the guest object given another guest object * (a kind of copy constructor). This object makes a private copy of data * of the original object passed as an argument. * * @note Locks @a aThat object for reading. */HRESULT USBDeviceFilter::initCopy(USBDeviceFilters *aParent, USBDeviceFilter *aThat){ LogFlowThisFunc(("aParent=%p, aThat=%p/n", aParent, aThat)); ComAssertRet(aParent && aThat, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mParent) = aParent; /* mPeer is left null */ m_fModified = false; /* sanity */ AutoCaller thatCaller(aThat); AssertComRCReturnRC(thatCaller.rc()); AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS); bd.attachCopy(aThat->bd); /* reset the arbitrary ID field * (this field is something unique that two distinct objects, even if they * are deep copies of each other, should not share) */ bd->mId = NULL; mInList = aThat->mInList; /* Confirm successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:41,
示例6: LogFlowThisFunc/** * Initializes the USB controller object. * * @returns COM result indicator. * @param aParent Pointer to our parent object. * @param aName The name of the USB controller. * @param enmType The USB controller type. */HRESULT USBController::init(Machine *aParent, const Utf8Str &aName, USBControllerType_T enmType){ LogFlowThisFunc(("aParent=%p aName=/"%s/"/n", aParent, aName.c_str())); ComAssertRet(aParent && !aName.isEmpty(), E_INVALIDARG); if ( (enmType <= USBControllerType_Null) || (enmType > USBControllerType_XHCI)) return setError(E_INVALIDARG, tr("Invalid USB controller type")); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m = new Data(aParent); /* mPeer is left null */ m->bd.allocate(); m->bd->strName = aName; m->bd->enmType = enmType; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:miguelinux,项目名称:vbox,代码行数:35,
示例7: LogFlowThisFunc/** * Initializes the machine debugger object. * * @returns COM result indicator * @param aParent handle of our parent object */HRESULT MachineDebugger::init(Console *aParent){ LogFlowThisFunc(("aParent=%p/n", aParent)); ComAssertRet(aParent, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mParent) = aParent; for (unsigned i = 0; i < RT_ELEMENTS(maiQueuedEmExecPolicyParams); i++) maiQueuedEmExecPolicyParams[i] = UINT8_MAX; mSingleStepQueued = -1; mRecompileUserQueued = -1; mRecompileSupervisorQueued = -1; mPatmEnabledQueued = -1; mCsamEnabledQueued = -1; mLogEnabledQueued = -1; mVirtualTimeRateQueued = UINT32_MAX; mFlushMode = false; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:svn2github,项目名称:virtualbox,代码行数:34,
示例8: LogFlowThisFunc/** * Initializes the medium attachment object given another guest object * (a kind of copy constructor). This object makes a private copy of data * of the original object passed as an argument. */HRESULT MediumAttachment::initCopy(Machine *aParent, MediumAttachment *aThat){ LogFlowThisFunc(("aParent=%p, aThat=%p/n", aParent, aThat)); ComAssertRet(aParent && aThat, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m = new Data(aParent); /* m->pPeer is left null */ AutoCaller thatCaller(aThat); AssertComRCReturnRC(thatCaller.rc()); AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); m->bd.attachCopy(aThat->m->bd); /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); /* Construct a short log name for this attachment. */ i_updateLogName(); LogFlowThisFunc(("LEAVE - %s/n", i_getLogName())); return S_OK;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:33,
示例9: LogFlowThisFuncHRESULT DisplaySourceBitmap::init(ComObjPtr<Display> pDisplay, unsigned uScreenId, DISPLAYFBINFO *pFBInfo){ LogFlowThisFunc(("[%u]/n", uScreenId)); ComAssertRet(!pDisplay.isNull(), E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m.pDisplay = pDisplay; m.uScreenId = uScreenId; m.pFBInfo = pFBInfo; m.pu8Allocated = NULL; m.pu8Address = NULL; m.ulWidth = 0; m.ulHeight = 0; m.ulBitsPerPixel = 0; m.ulBytesPerLine = 0; m.bitmapFormat = BitmapFormat_Opaque; int rc = initSourceBitmap(uScreenId, pFBInfo); if (RT_FAILURE(rc)) return E_FAIL; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:zBMNForks,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:33,
示例10: LogFlowThisFunc/** * Initializes the bandwidth group object. * * @returns COM result indicator. * @param aParent Pointer to our parent object. * @param aName Name of the bandwidth group. * @param aType Type of the bandwidth group (net, disk). * @param aMaxBytesPerSec Maximum bandwidth for the bandwidth group. */HRESULT BandwidthGroup::init(BandwidthControl *aParent, const Utf8Str &aName, BandwidthGroupType_T aType, LONG64 aMaxBytesPerSec){ LogFlowThisFunc(("aParent=%p aName=/"%s/"/n", aParent, aName.c_str())); ComAssertRet(aParent && !aName.isEmpty(), E_INVALIDARG); if ( (aType <= BandwidthGroupType_Null) || (aType > BandwidthGroupType_Network)) return setError(E_INVALIDARG, tr("Invalid bandwidth group type type")); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m = new Data(aParent); /* m->pPeer is left null */ m->bd.allocate(); m->bd->strName = aName; m->bd->enmType = aType; m->bd->cReferences = 0; m->bd->aMaxBytesPerSec = aMaxBytesPerSec; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:jeppeter,项目名称:vbox,代码行数:43,
示例11: ComAssertRetHRESULT Guest::facilityUpdate(VBoxGuestFacilityType enmFacility, VBoxGuestFacilityStatus enmStatus){ ComAssertRet(enmFacility < INT32_MAX, E_INVALIDARG); HRESULT rc; RTTIMESPEC tsNow; RTTimeNow(&tsNow); FacilityMapIter it = mData.mFacilityMap.find((AdditionsFacilityType_T)enmFacility); if (it != mData.mFacilityMap.end()) { AdditionsFacility *pFac = it->second; rc = pFac->update((AdditionsFacilityStatus_T)enmStatus, tsNow); } else { ComObjPtr<AdditionsFacility> pFacility; pFacility.createObject(); ComAssert(!pFacility.isNull()); rc = pFacility->init(this, (AdditionsFacilityType_T)enmFacility, (AdditionsFacilityStatus_T)enmStatus); if (SUCCEEDED(rc)) mData.mFacilityMap.insert(std::make_pair((AdditionsFacilityType_T)enmFacility, pFacility)); } LogFlowFunc(("Returned with rc=%Rrc/n")); return rc;}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:29,
示例12: LogFlowThisFunc/** * Initializes the USB controller object given another guest object * (a kind of copy constructor). This object makes a private copy of data * of the original object passed as an argument. */HRESULT USBDeviceFilters::initCopy(Machine *aParent, USBDeviceFilters *aPeer){ LogFlowThisFunc(("aParent=%p, aPeer=%p/n", aParent, aPeer)); ComAssertRet(aParent && aPeer, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m = new Data(aParent); /* mPeer is left null */ AutoWriteLock thatlock(aPeer COMMA_LOCKVAL_SRC_POS);#ifdef VBOX_WITH_USB /* create private copies of all filters */ m->llDeviceFilters.allocate(); DeviceFilterList::const_iterator it = aPeer->m->llDeviceFilters->begin(); while (it != aPeer->m->llDeviceFilters->end()) { ComObjPtr<USBDeviceFilter> pFilter; pFilter.createObject(); pFilter->initCopy(this, *it); m->llDeviceFilters->push_back(pFilter); ++it; }#endif /* VBOX_WITH_USB */ /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:mcenirm,项目名称:vbox,代码行数:40,
示例13: LogFlowThisFunc/** * Initializes the Serial Port object given another serial port object * (a kind of copy constructor). This object shares data with * the object passed as an argument. * * @note This object must be destroyed before the original object * it shares data with is destroyed. * * @note Locks @a aThat object for reading. */HRESULT SerialPort::init(Machine *aParent, SerialPort *aThat){ LogFlowThisFunc(("aParent=%p, aThat=%p/n", aParent, aThat)); ComAssertRet(aParent && aThat, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); m = new Data(); unconst(m->pMachine) = aParent; unconst(m->pPeer) = aThat; AutoCaller thatCaller (aThat); AssertComRCReturnRC(thatCaller.rc()); AutoReadLock thatLock(aThat COMMA_LOCKVAL_SRC_POS); m->bd.share (aThat->m->bd); /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:mcenirm,项目名称:vbox,代码行数:36,
示例14: LogFlowThisFunc/** * Initializes the guest OS type object. * * @returns COM result indicator * @param aFamilyId os family short name string * @param aFamilyDescription os family name string * @param aId os short name string * @param aDescription os name string * @param aOSType global OS type ID * @param aOSHint os configuration hint * @param aRAMSize recommended RAM size in megabytes * @param aVRAMSize recommended video memory size in megabytes * @param aHDDSize recommended HDD size in bytes */HRESULT GuestOSType::init(const Global::OSType &ostype)/*const char *aFamilyId, const char *aFamilyDescription, const char *aId, const char *aDescription, VBOXOSTYPE aOSType, uint32_t aOSHint, uint32_t aRAMSize, uint32_t aVRAMSize, uint64_t aHDDSize, NetworkAdapterType_T aNetworkAdapterType, uint32_t aNumSerialEnabled, StorageControllerType_T aDVDStorageControllerType, StorageBus_T aDVDStorageBusType, StorageControllerType_T aHDStorageControllerType, StorageBus_T aHDStorageBusType, ChipsetType_T aChipsetType AudioControllerType_T aAudioControllerType*/{#if 0 LogFlowThisFunc(("aFamilyId='%s', aFamilyDescription='%s', " "aId='%s', aDescription='%s', " "aType=%d, aOSHint=%x, " "aRAMSize=%d, aVRAMSize=%d, aHDDSize=%lld, " "aNetworkAdapterType=%d, aNumSerialEnabled=%d, " "aStorageControllerType=%d/n", aFamilyId, aFamilyDescription, aId, aDescription, aOSType, aOSHint, aRAMSize, aVRAMSize, aHDDSize, aNetworkAdapterType, aNumSerialEnabled, aStorageControllerType));#endif ComAssertRet(ostype.familyId && ostype.familyDescription && ostype.id && ostype.description, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mFamilyID) = ostype.familyId; unconst(mFamilyDescription) = ostype.familyDescription; unconst(mID) = ostype.id; unconst(mDescription) = ostype.description; unconst(mOSType) = ostype.osType; unconst(mOSHint) = ostype.osHint; unconst(mRAMSize) = ostype.recommendedRAM; unconst(mVRAMSize) = ostype.recommendedVRAM; unconst(mHDDSize) = ostype.recommendedHDD; unconst(mNetworkAdapterType) = ostype.networkAdapterType; unconst(mNumSerialEnabled) = ostype.numSerialEnabled; unconst(mDVDStorageControllerType) = ostype.dvdStorageControllerType; unconst(mDVDStorageBusType) = ostype.dvdStorageBusType; unconst(mHDStorageControllerType) = ostype.hdStorageControllerType; unconst(mHDStorageBusType) = ostype.hdStorageBusType; unconst(mChipsetType) = ostype.chipsetType; unconst(mAudioControllerType) = ostype.audioControllerType; unconst(mAudioCodecType) = ostype.audioCodecType; /* Confirm a successful initialization when it's the case */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:jeppeter,项目名称:vbox,代码行数:73,
示例15: LogFlowThisFuncHRESULT PCIDeviceAttachment::initCopy(IMachine *aParent, PCIDeviceAttachment *aThat){ LogFlowThisFunc(("aParent=%p, aThat=%p/n", aParent, aThat)); ComAssertRet(aParent && aThat, E_INVALIDARG); return init(aParent, aThat->m->DevName, aThat->m->HostAddress, aThat->m->GuestAddress, aThat->m->fPhysical);}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:8,
示例16: ComAssertRet/** * Send an absolute position event to the VMM device. * @note all calls out of this object are made with no locks held! * * @returns COM status code */HRESULT Mouse::reportAbsEventToVMMDev(int32_t x, int32_t y){ VMMDevMouseInterface *pVMMDev = mParent->getVMMDevMouseInterface(); ComAssertRet(pVMMDev, E_FAIL); PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort(); ComAssertRet(pVMMDevPort, E_FAIL); if (x != mcLastX || y != mcLastY) { int vrc = pVMMDevPort->pfnSetAbsoluteMouse(pVMMDevPort, x, y); if (RT_FAILURE(vrc)) return setError(VBOX_E_IPRT_ERROR, tr("Could not send the mouse event to the virtual mouse (%Rrc)"), vrc); } return S_OK;}
开发者ID:apaka,项目名称:vbox,代码行数:24,
示例17: ComAssertRet/** * Send an absolute position event to the display device. * @note all calls out of this object are made with no locks held! * @param x Cursor X position in pixels relative to the first screen, where * (1, 1) is the upper left corner. * @param y Cursor Y position in pixels relative to the first screen, where * (1, 1) is the upper left corner. */HRESULT Mouse::i_reportAbsEventToDisplayDevice(int32_t x, int32_t y){ DisplayMouseInterface *pDisplay = mParent->getDisplayMouseInterface(); ComAssertRet(pDisplay, E_FAIL); if (x != mcLastX || y != mcLastY) { pDisplay->i_reportHostCursorPosition(x - 1, y - 1); } return S_OK;}
开发者ID:bayasist,项目名称:vbox,代码行数:19,
示例18: LogFlowThisFunc/** * Initializes the host object. * * @returns COM result indicator * @param aInterfaceName name of the network interface * @param aGuid GUID of the host network interface */HRESULT HostNetworkInterface::init(Bstr aInterfaceName, Guid aGuid, HostNetworkInterfaceType_T ifType){ LogFlowThisFunc(("aInterfaceName={%ls}, aGuid={%s}/n", aInterfaceName.raw(), aGuid.toString().c_str())); ComAssertRet(!aInterfaceName.isEmpty(), E_INVALIDARG); ComAssertRet(!aGuid.isEmpty(), E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mInterfaceName) = aInterfaceName; unconst(mGuid) = aGuid; mIfType = ifType; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:28,
示例19: LogFlowThisFunc/** * Initializes the system information object. * * @returns COM result indicator */HRESULT SystemProperties::init(VirtualBox *aParent){ LogFlowThisFunc(("aParent=%p/n", aParent)); ComAssertRet(aParent, E_FAIL); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mParent) = aParent; setDefaultMachineFolder(Utf8Str::Empty); setDefaultHardDiskFormat(Utf8Str::Empty); setVRDEAuthLibrary(Utf8Str::Empty); setDefaultVRDEExtPack(Utf8Str::Empty); m->ulLogHistoryCount = 3; HRESULT rc = S_OK; /* Fetch info of all available hd backends. */ /// @todo NEWMEDIA VDBackendInfo needs to be improved to let us enumerate /// any number of backends VDBACKENDINFO aVDInfo[100]; unsigned cEntries; int vrc = VDBackendInfo(RT_ELEMENTS(aVDInfo), aVDInfo, &cEntries); AssertRC(vrc); if (RT_SUCCESS(vrc)) { for (unsigned i = 0; i < cEntries; ++ i) { ComObjPtr<MediumFormat> hdf; rc = hdf.createObject(); if (FAILED(rc)) break; rc = hdf->init(&aVDInfo[i]); if (FAILED(rc)) break; m_llMediumFormats.push_back(hdf); } } /* Confirm a successful initialization */ if (SUCCEEDED(rc)) autoInitSpan.setSucceeded(); return rc;}
开发者ID:greg100795,项目名称:virtualbox,代码行数:57,
示例20: ComAssertRet/** * Initializes the host object. * * @returns COM result indicator * @param aInterfaceName name of the network interface * @param aGuid GUID of the host network interface */HRESULT HostNetworkInterface::init(Utf8Str aInterfaceName, HostNetworkInterfaceType_T ifType, PNETIFINFO pIf){// LogFlowThisFunc(("aInterfaceName={%s}, aGuid={%s}/n",// aInterfaceName.c_str(), aGuid.toString().c_str()));// ComAssertRet(aInterfaceName, E_INVALIDARG);// ComAssertRet(aGuid.isValid(), E_INVALIDARG); ComAssertRet(pIf, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mInterfaceName) = aInterfaceName; unconst(mGuid) = pIf->Uuid; if (pIf->szShortName[0]) { unconst(mNetworkName) = i_composeNetworkName(pIf->szShortName); unconst(mShortName) = pIf->szShortName; } else { unconst(mNetworkName) = i_composeNetworkName(aInterfaceName); unconst(mShortName) = aInterfaceName; } mIfType = ifType; int iPrefixIPv6; m.realIPAddress = m.IPAddress = pIf->IPAddress.u; m.realNetworkMask = m.networkMask = pIf->IPNetMask.u; if (pIf->IPv6Address.s.Lo || pIf->IPv6Address.s.Hi) m.realIPV6Address = m.IPV6Address = Utf8StrFmt("%RTnaipv6", &pIf->IPv6Address); else m.realIPV6Address = m.IPV6Address = Utf8Str::Empty; RTNetMaskToPrefixIPv6(&pIf->IPv6NetMask, &iPrefixIPv6); m.realIPV6PrefixLength = m.IPV6NetworkMaskPrefixLength = iPrefixIPv6; m.dhcpEnabled = pIf->fDhcpEnabled; m.hardwareAddress = Utf8StrFmt("%RTmac", &pIf->MACAddress); AssertCompile((unsigned)NETIF_T_UNKNOWN == (unsigned)HostNetworkInterfaceMediumType_Unknown); m.mediumType = (HostNetworkInterfaceMediumType_T)pIf->enmMediumType; AssertCompile((unsigned)NETIF_S_UNKNOWN == (unsigned)HostNetworkInterfaceStatus_Unknown); m.status = (HostNetworkInterfaceStatus_T)pIf->enmStatus; m.speedMbits = pIf->uSpeedMbits; m.wireless = pIf->fWireless; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:mdaniel,项目名称:virtualbox-org-svn-vbox-trunk,代码行数:58,
示例21: ComAssertRet/** * Initializes the host object. * * @returns COM result indicator * @param aInterfaceName name of the network interface * @param aGuid GUID of the host network interface */HRESULT HostNetworkInterface::init(Bstr aInterfaceName, HostNetworkInterfaceType_T ifType, PNETIFINFO pIf){// LogFlowThisFunc(("aInterfaceName={%ls}, aGuid={%s}/n",// aInterfaceName.raw(), aGuid.toString().raw()));// ComAssertRet(aInterfaceName, E_INVALIDARG);// ComAssertRet(aGuid.isValid(), E_INVALIDARG); ComAssertRet(pIf, E_INVALIDARG); /* Enclose the state transition NotReady->InInit->Ready */ AutoInitSpan autoInitSpan(this); AssertReturn(autoInitSpan.isOk(), E_FAIL); unconst(mInterfaceName) = aInterfaceName; unconst(mGuid) = pIf->Uuid; if (pIf->szShortName[0]) { unconst(mNetworkName) = i_composeNetworkName(pIf->szShortName); unconst(mShortName) = pIf->szShortName; } else { unconst(mNetworkName) = i_composeNetworkName(aInterfaceName); unconst(mShortName) = aInterfaceName; } mIfType = ifType; m.realIPAddress = m.IPAddress = pIf->IPAddress.u; m.realNetworkMask = m.networkMask = pIf->IPNetMask.u; m.realIPV6Address = m.IPV6Address = composeIPv6Address(&pIf->IPv6Address); m.realIPV6PrefixLength = m.IPV6NetworkMaskPrefixLength = composeIPv6PrefixLenghFromAddress(&pIf->IPv6NetMask); m.dhcpEnabled = pIf->bDhcpEnabled; m.hardwareAddress = composeHardwareAddress(&pIf->MACAddress);#ifdef RT_OS_WINDOWS m.mediumType = (HostNetworkInterfaceMediumType)pIf->enmMediumType; m.status = (HostNetworkInterfaceStatus)pIf->enmStatus;#else /* !RT_OS_WINDOWS */ m.mediumType = pIf->enmMediumType; m.status = pIf->enmStatus;#endif /* !RT_OS_WINDOWS */ m.speedMbits = pIf->uSpeedMbits; /* Confirm a successful initialization */ autoInitSpan.setSucceeded(); return S_OK;}
开发者ID:sobomax,项目名称:virtualbox_64bit_edd,代码行数:54,
注:本文中的ComAssertRet函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Com_Clamp函数代码示例 C++ ComAscStr2Uni函数代码示例 |