当前位置: 首页>>代码示例>>C++>>正文


C++ AssertComRCReturn函数代码示例

本文整理汇总了C++中AssertComRCReturn函数的典型用法代码示例。如果您正苦于以下问题:C++ AssertComRCReturn函数的具体用法?C++ AssertComRCReturn怎么用?C++ AssertComRCReturn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AssertComRCReturn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: destroyClientListener

int destroyClientListener(ComNatListenerPtr& listener, const ComVirtualBoxClientPtr& vboxclientptr)
{
    if (listener)
    {
        ComPtr<IEventSource> esVBox;
        HRESULT hrc = vboxclientptr->COMGETTER(EventSource)(esVBox.asOutParam());
        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
        if (!esVBox.isNull())
        {
            hrc = esVBox->UnregisterListener(listener);
            AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
        }
        listener.setNull();
    }
    return VINF_SUCCESS;
}
开发者ID:miguelinux,项目名称:vbox,代码行数:16,代码来源:ComHostUtils.cpp

示例2: AssertComRCReturn

int VBoxNetBaseService::init()
{
    if (isMainNeeded())
    {
        HRESULT hrc = com::Initialize();
        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

        hrc = virtualboxClient.createInprocObject(CLSID_VirtualBoxClient);
        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

        hrc = virtualboxClient->COMGETTER(VirtualBox)(virtualbox.asOutParam());
        AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
    }

    return VINF_SUCCESS;
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:16,代码来源:VBoxNetBaseService.cpp

示例3: autoCaller

bool ParallelPort::i_hasDefaults()
{
    /* sanity */
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), true);

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);

    if (!m->bd->fEnabled)
    {
        /* Could be default, check the IO base and IRQ. */
        switch (m->bd->ulSlot)
        {
            case 0:
                if (m->bd->ulIOBase == 0x378 && m->bd->ulIRQ == 7)
                    return true;
                break;
            case 1:
                if (m->bd->ulIOBase == 0x278 && m->bd->ulIRQ == 5)
                    return true;
                break;
            default:
                AssertMsgFailed(("Parallel port slot %u exceeds limit\n", m->bd->ulSlot));
                break;
        }

        /* Detect old-style defaults (0x378, irq 4) in any slot, they are still
         * in place for many VMs created by old VirtualBox versions. */
        if (m->bd->ulIOBase == 0x378 && m->bd->ulIRQ == 4)
            return true;
    }

    return false;
}
开发者ID:miguelinux,项目名称:vbox,代码行数:34,代码来源:ParallelPortImpl.cpp

示例4: autoCaller

/**
 * Returns a medium format object corresponding to the given file extension or
 * null if no such format.
 *
 * @param aExt   File extension.
 *
 * @return ComObjPtr<MediumFormat>
 */
ComObjPtr<MediumFormat> SystemProperties::i_mediumFormatFromExtension(const Utf8Str &aExt)
{
    ComObjPtr<MediumFormat> format;

    AutoCaller autoCaller(this);
    AssertComRCReturn (autoCaller.rc(), format);

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);

    bool fFound = false;
    for (MediumFormatList::const_iterator it = m_llMediumFormats.begin();
         it != m_llMediumFormats.end() && !fFound;
         ++it)
    {
        /* MediumFormat is all const, no need to lock */
        MediumFormat::StrArray aFileList = (*it)->i_getFileExtensions();
        for (MediumFormat::StrArray::const_iterator it1 = aFileList.begin();
             it1 != aFileList.end();
             ++it1)
        {
            if ((*it1).compare(aExt, Utf8Str::CaseInsensitive) == 0)
            {
                format = *it;
                fFound = true;
                break;
            }
        }
    }

    return format;
}
开发者ID:jeppeter,项目名称:vbox,代码行数:39,代码来源:SystemPropertiesImpl.cpp

示例5: Assert

/* static */
int NativeEventQueue::init()
{
    Assert(sMainQueue == NULL);
    Assert(RTThreadIsMain(RTThreadSelf()));

    try
    {
        sMainQueue = new NativeEventQueue();
        AssertPtr(sMainQueue);
#ifdef VBOX_WITH_XPCOM
        /* Check that it actually is the main event queue, i.e. that
           we're called on the right thread. */
        nsCOMPtr<nsIEventQueue> q;
        nsresult rv = NS_GetMainEventQ(getter_AddRefs(q));
        AssertComRCReturn(rv, VERR_INVALID_POINTER);
        Assert(q == sMainQueue->mEventQ);

        /* Check that it's a native queue. */
        PRBool fIsNative = PR_FALSE;
        rv = sMainQueue->mEventQ->IsQueueNative(&fIsNative);
        Assert(NS_SUCCEEDED(rv) && fIsNative);
#endif // VBOX_WITH_XPCOM
    }
    catch (std::bad_alloc &ba)
    {
        NOREF(ba);
        return VERR_NO_MEMORY;
    }

    return VINF_SUCCESS;
}
开发者ID:caidongyun,项目名称:tray,代码行数:32,代码来源:NativeEventQueue.cpp

示例6: autoCaller

STDMETHODIMP Session::OnShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId)
{
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);

    AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE);
#ifndef VBOX_COM_INPROC_API_CLIENT
    AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE);
#endif

    if (mState != SessionState_Locked)
    {
        /* the call from Machine issued when the session is open can arrive
         * after the session starts closing or gets closed. Note that when
         * aCheck is false, we return E_FAIL to indicate that aWinId we return
         * is not valid */
        *aCanShow = FALSE;
        *aWinId = 0;
        return aCheck ? S_OK : E_FAIL;
    }

#ifndef VBOX_COM_INPROC_API_CLIENT
    return mConsole->onShowWindow(aCheck, aCanShow, aWinId);
#else
    return S_OK;
#endif
}
开发者ID:bayasist,项目名称:vbox,代码行数:29,代码来源:SessionImpl.cpp

示例7: autoCaller

/**
 *  Returns true if the given USB device matches to at least one of
 *  this controller's USB device filters.
 *
 *  A HostUSBDevice specific version.
 *
 *  @note Locks this object for reading.
 */
bool USBDeviceFilters::i_hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
{
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), false);

    /* It is not possible to work with USB device if there is no USB controller present. */
    if (!m->pParent->i_isUSBControllerPresent())
        return false;

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);

    /* apply self filters */
    for (DeviceFilterList::const_iterator it = m->llDeviceFilters->begin();
         it != m->llDeviceFilters->end();
         ++it)
    {
        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
        if (aDevice->i_isMatch((*it)->i_getData()))
        {
            *aMaskedIfs = (*it)->i_getData().mMaskedIfs;
            return true;
        }
    }

    return false;
}
开发者ID:mcenirm,项目名称:vbox,代码行数:34,代码来源:USBDeviceFiltersImpl.cpp

示例8: LogFlowThisFuncEnter

STDMETHODIMP Session::GetRemoteConsole(IConsole **aConsole)
{
    LogFlowThisFuncEnter();
    AssertReturn(aConsole, E_POINTER);

    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);

    AssertReturn(mState != SessionState_Unlocked, VBOX_E_INVALID_VM_STATE);

#ifndef VBOX_COM_INPROC_API_CLIENT
    AssertMsgReturn(mType == SessionType_WriteLock && !!mConsole,
                    ("This is not a direct session!\n"),
                    VBOX_E_INVALID_OBJECT_STATE);

    /* return a failure if the session already transitioned to Closing
     * but the server hasn't processed Machine::OnSessionEnd() yet. */
    if (mState != SessionState_Locked)
        return VBOX_E_INVALID_VM_STATE;

    mConsole.queryInterfaceTo(aConsole);

    LogFlowThisFuncLeave();

    return S_OK;

#else  /* VBOX_COM_INPROC_API_CLIENT */
    AssertFailed();
    return VBOX_E_INVALID_OBJECT_STATE;
#endif /* VBOX_COM_INPROC_API_CLIENT */
}
开发者ID:bayasist,项目名称:vbox,代码行数:33,代码来源:SessionImpl.cpp

示例9: autoCaller

bool USBDeviceFilter::i_isModified()
{
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), false);

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    return m_fModified;
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:8,代码来源:USBDeviceFilterImpl.cpp

示例10: autoCaller

STDMETHODIMP Session::EnableVMMStatistics(BOOL aEnable)
{
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    mConsole->enableVMMStatistics(aEnable);

    return S_OK;
}
开发者ID:quiquetux,项目名称:jokte-ba-as,代码行数:9,代码来源:SessionImpl.cpp

示例11: DECLCALLBACK

DECLCALLBACK(int) VBoxNetBaseService::Data::recvLoop(RTTHREAD, void *pvUser)
{
    VBoxNetBaseService *pThis = static_cast<VBoxNetBaseService *>(pvUser);

    HRESULT hrc = com::Initialize();
    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

    pThis->doReceiveLoop();

    return VINF_SUCCESS;
}
开发者ID:svn2github,项目名称:virtualbox,代码行数:11,代码来源:VBoxNetBaseService.cpp

示例12: autoCaller

STDMETHODIMP Session::SaveStateWithReason(Reason_T aReason, IProgress **aProgress)
{
    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE);
    AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE);
    AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE);

    return mConsole->saveState(aReason, aProgress);
}
开发者ID:apaka,项目名称:vbox,代码行数:12,代码来源:SessionImpl.cpp

示例13: createClientListener

int createClientListener(ComNatListenerPtr& listener, const ComVirtualBoxClientPtr& vboxclientptr,
                         NATNetworkEventAdapter *adapter, /* const */ ComEventTypeArray& events)
{
    ComObjPtr<NATNetworkListenerImpl> obj;
    HRESULT hrc = obj.createObject();
    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

    hrc = obj->init(new NATNetworkListener(), adapter);
    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

    ComPtr<IEventSource> esVBox;
    hrc = vboxclientptr->COMGETTER(EventSource)(esVBox.asOutParam());
    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

    listener = obj;

    hrc = esVBox->RegisterListener(listener, ComSafeArrayAsInParam(events), true);
    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);

    return VINF_SUCCESS;
}
开发者ID:miguelinux,项目名称:vbox,代码行数:21,代码来源:ComHostUtils.cpp

示例14: LogFlowThisFunc

STDMETHODIMP Session::OnStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove)
{
    LogFlowThisFunc(("\n"));

    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE);
    AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE);

    return mConsole->onStorageDeviceChange(aMediumAttachment, aRemove);
}
开发者ID:quiquetux,项目名称:jokte-ba-as,代码行数:13,代码来源:SessionImpl.cpp

示例15: LogFlowThisFunc

STDMETHODIMP Session::OnDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode)
{
    LogFlowThisFunc(("\n"));

    AutoCaller autoCaller(this);
    AssertComRCReturn(autoCaller.rc(), autoCaller.rc());

    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE);
    AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE);

    return mConsole->onDragAndDropModeChange(aDragAndDropMode);
}
开发者ID:apaka,项目名称:vbox,代码行数:13,代码来源:SessionImpl.cpp


注:本文中的AssertComRCReturn函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。