Example #1
0
STDMETHODIMP HostWrap::GetProcessorFeature(ProcessorFeature_T aFeature,
                                           BOOL *aSupported)
{
    LogRelFlow(("{%p} %s:enter aFeature=%RU32 aSupported=%p\n", this, "Host::getProcessorFeature", aFeature, aSupported));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aSupported);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getProcessorFeature(aFeature,
                                  aSupported);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aSupported=%RTbool hrc=%Rhrc\n", this, "Host::getProcessorFeature", *aSupported, hrc));
    return hrc;
}
Example #2
0
STDMETHODIMP MachineDebuggerWrap::DumpStats(IN_BSTR aPattern)
{
    LogRelFlow(("{%p} %s:enter aPattern=%ls\n", this, "MachineDebugger::dumpStats", aPattern));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = dumpStats(BSTRInConverter(aPattern).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::dumpStats", hrc));
    return hrc;
}
Example #3
0
STDMETHODIMP MachineDebuggerWrap::COMSETTER(CSAMEnabled)(BOOL aCSAMEnabled)
{
    LogRelFlow(("{%p} %s: enter aCSAMEnabled=%RTbool\n", this, "MachineDebugger::setCSAMEnabled", aCSAMEnabled));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setCSAMEnabled(aCSAMEnabled);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::setCSAMEnabled", hrc));
    return hrc;
}
Example #4
0
STDMETHODIMP MachineDebuggerWrap::GetRegisters(ULONG aCpuId,
                                               ComSafeArrayOut(BSTR, aNames),
                                               ComSafeArrayOut(BSTR, aValues))
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aNames=%p aValues=%p\n", this, "MachineDebugger::getRegisters", aCpuId, aNames, aValues));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aNames);
        CheckComArgOutPointerValidThrow(aValues);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getRegisters(aCpuId,
                           ArrayBSTROutConverter(ComSafeArrayOutArg(aNames)).array(),
                           ArrayBSTROutConverter(ComSafeArrayOutArg(aValues)).array());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aNames=%zu *aValues=%zu hrc=%Rhrc\n", this, "MachineDebugger::getRegisters", ComSafeArraySize(*aNames), ComSafeArraySize(*aValues), hrc));
    return hrc;
}
Example #5
0
STDMETHODIMP MachineDebuggerWrap::SetRegisters(ULONG aCpuId,
                                               ComSafeArrayIn(IN_BSTR, aNames),
                                               ComSafeArrayIn(IN_BSTR, aValues))
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aNames=%zu aValues=%zu\n", this, "MachineDebugger::setRegisters", aCpuId, aNames, aValues));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setRegisters(aCpuId,
                           ArrayBSTRInConverter(ComSafeArrayInArg(aNames)).array(),
                           ArrayBSTRInConverter(ComSafeArrayInArg(aValues)).array());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::setRegisters", hrc));
    return hrc;
}
Example #6
0
STDMETHODIMP MachineDebuggerWrap::InjectNMI()
{
    LogRelFlow(("{%p} %s:enter\n", this, "MachineDebugger::injectNMI"));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = injectNMI();
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::injectNMI", hrc));
    return hrc;
}
Example #7
0
STDMETHODIMP MachineDebuggerWrap::WriteVirtualMemory(ULONG aCpuId,
                                                     LONG64 aAddress,
                                                     ULONG aSize,
                                                     ComSafeArrayIn(BYTE, aBytes))
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aAddress=%RI64 aSize=%RU32 aBytes=%zu\n", this, "MachineDebugger::writeVirtualMemory", aCpuId, aAddress, aSize, aBytes));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = writeVirtualMemory(aCpuId,
                                 aAddress,
                                 aSize,
                                 ArrayInConverter<BYTE>(ComSafeArrayInArg(aBytes)).array());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::writeVirtualMemory", hrc));
    return hrc;
}
Example #8
0
STDMETHODIMP HostWrap::RemoveUSBDeviceFilter(ULONG aPosition)
{
    LogRelFlow(("{%p} %s:enter aPosition=%RU32\n", this, "Host::removeUSBDeviceFilter", aPosition));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = removeUSBDeviceFilter(aPosition);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "Host::removeUSBDeviceFilter", hrc));
    return hrc;
}
Example #9
0
STDMETHODIMP HostWrap::COMGETTER(USBDevices)(ComSafeArrayOut(IHostUSBDevice *, aUSBDevices))
{
    LogRelFlow(("{%p} %s: enter aUSBDevices=%p\n", this, "Host::getUSBDevices", aUSBDevices));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aUSBDevices);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getUSBDevices(ArrayComTypeOutConverter<IHostUSBDevice>(ComSafeArrayOutArg(aUSBDevices)).array());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aUSBDevices=%zu hrc=%Rhrc\n", this, "Host::getUSBDevices", ComSafeArraySize(*aUSBDevices), hrc));
    return hrc;
}
Example #10
0
STDMETHODIMP HostWrap::CreateUSBDeviceFilter(IN_BSTR aName,
                                             IHostUSBDeviceFilter **aFilter)
{
    LogRelFlow(("{%p} %s:enter aName=%ls aFilter=%p\n", this, "Host::createUSBDeviceFilter", aName, aFilter));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aFilter);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = createUSBDeviceFilter(BSTRInConverter(aName).str(),
                                    ComTypeOutConverter<IHostUSBDeviceFilter>(aFilter).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aFilter=%p hrc=%Rhrc\n", this, "Host::createUSBDeviceFilter", *aFilter, hrc));
    return hrc;
}
Example #11
0
STDMETHODIMP HostWrap::InsertUSBDeviceFilter(ULONG aPosition,
                                             IHostUSBDeviceFilter *aFilter)
{
    LogRelFlow(("{%p} %s:enter aPosition=%RU32 aFilter=%p\n", this, "Host::insertUSBDeviceFilter", aPosition, aFilter));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = insertUSBDeviceFilter(aPosition,
                                    ComTypeInConverter<IHostUSBDeviceFilter>(aFilter).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "Host::insertUSBDeviceFilter", hrc));
    return hrc;
}
Example #12
0
STDMETHODIMP HostWrap::RemoveHostOnlyNetworkInterface(IN_BSTR aId,
                                                      IProgress **aProgress)
{
    LogRelFlow(("{%p} %s:enter aId=%ls aProgress=%p\n", this, "Host::removeHostOnlyNetworkInterface", aId, aProgress));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aProgress);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = removeHostOnlyNetworkInterface(UuidInConverter(aId).uuid(),
                                             ComTypeOutConverter<IProgress>(aProgress).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aProgress=%p hrc=%Rhrc\n", this, "Host::removeHostOnlyNetworkInterface", *aProgress, hrc));
    return hrc;
}
Example #13
0
STDMETHODIMP HostWrap::CreateHostOnlyNetworkInterface(IHostNetworkInterface **aHostInterface,
                                                      IProgress **aProgress)
{
    LogRelFlow(("{%p} %s:enter aHostInterface=%p aProgress=%p\n", this, "Host::createHostOnlyNetworkInterface", aHostInterface, aProgress));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aHostInterface);
        CheckComArgOutPointerValidThrow(aProgress);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = createHostOnlyNetworkInterface(ComTypeOutConverter<IHostNetworkInterface>(aHostInterface).ptr(),
                                             ComTypeOutConverter<IProgress>(aProgress).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aHostInterface=%p aProgress=%p hrc=%Rhrc\n", this, "Host::createHostOnlyNetworkInterface", *aHostInterface, *aProgress, hrc));
    return hrc;
}
Example #14
0
STDMETHODIMP HostWrap::GetProcessorDescription(ULONG aCpuId,
                                               BSTR *aDescription)
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aDescription=%p\n", this, "Host::getProcessorDescription", aCpuId, aDescription));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aDescription);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getProcessorDescription(aCpuId,
                                      BSTROutConverter(aDescription).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aDescription=%ls hrc=%Rhrc\n", this, "Host::getProcessorDescription", *aDescription, hrc));
    return hrc;
}
void UIMediumEnumerator::sltHandleMachineUpdate(QString strMachineID)
{
    LogRelFlow(("UIMediumEnumerator: Machine event received, ID = %s\n", strMachineID.toAscii().constData()));

    /* Compose a map of previous usage: */
    QStringList oldUsage;
    foreach (const QString &strMediumID, mediumIDs())
    {
        const UIMedium &uimedium = m_mediums[strMediumID];
        const QList<QString> &machineIDs = uimedium.machineIds();
        if (machineIDs.contains(strMachineID))
            oldUsage << strMediumID;
    }
    LogRelFlow(("UIMediumEnumerator:  Old usage: %s\n", oldUsage.isEmpty() ? "<empty>" : oldUsage.join(", ").toAscii().constData()));

    /* Compose a map of current usage: */
    QStringList newUsage;
    QMap<QString, CMedium> newMediumMap;
    CMachine machine = vboxGlobal().virtualBox().FindMachine(strMachineID);
    if (!machine.isNull())
    {
        CMediumAttachmentVector attachments = machine.GetMediumAttachments();
        foreach (const CMediumAttachment &attachment, attachments)
        {
            CMedium cmedium = attachment.GetMedium();
            if (cmedium.isNull())
                continue;
            QString strMediumID = cmedium.GetId();
            newMediumMap.insert(strMediumID, cmedium);
            newUsage << strMediumID;
        }
Example #16
0
STDMETHODIMP HostWrap::FindHostNetworkInterfaceByName(IN_BSTR aName,
                                                      IHostNetworkInterface **aNetworkInterface)
{
    LogRelFlow(("{%p} %s:enter aName=%ls aNetworkInterface=%p\n", this, "Host::findHostNetworkInterfaceByName", aName, aNetworkInterface));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aNetworkInterface);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = findHostNetworkInterfaceByName(BSTRInConverter(aName).str(),
                                             ComTypeOutConverter<IHostNetworkInterface>(aNetworkInterface).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aNetworkInterface=%p hrc=%Rhrc\n", this, "Host::findHostNetworkInterfaceByName", *aNetworkInterface, hrc));
    return hrc;
}
Example #17
0
STDMETHODIMP MachineDebuggerWrap::Info(IN_BSTR aName,
                                       IN_BSTR aArgs,
                                       BSTR *aInfo)
{
    LogRelFlow(("{%p} %s:enter aName=%ls aArgs=%ls aInfo=%p\n", this, "MachineDebugger::info", aName, aArgs, aInfo));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aInfo);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = info(BSTRInConverter(aName).str(),
                   BSTRInConverter(aArgs).str(),
                   BSTROutConverter(aInfo).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aInfo=%ls hrc=%Rhrc\n", this, "MachineDebugger::info", *aInfo, hrc));
    return hrc;
}
STDMETHODIMP SessionStateChangedEventWrap::COMGETTER(MachineId)(BSTR *aMachineId)
{
    LogRelFlow(("{%p} %s: enter aMachineId=%p\n", this, "SessionStateChangedEvent::getMachineId", aMachineId));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aMachineId);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getMachineId(UuidOutConverter(aMachineId).uuid());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aMachineId=%ls hrc=%Rhrc\n", this, "SessionStateChangedEvent::getMachineId", *aMachineId, hrc));
    return hrc;
}
Example #19
0
STDMETHODIMP MachineDebuggerWrap::ReadPhysicalMemory(LONG64 aAddress,
                                                     ULONG aSize,
                                                     ComSafeArrayOut(BYTE, aBytes))
{
    LogRelFlow(("{%p} %s:enter aAddress=%RI64 aSize=%RU32 aBytes=%p\n", this, "MachineDebugger::readPhysicalMemory", aAddress, aSize, aBytes));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aBytes);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = readPhysicalMemory(aAddress,
                                 aSize,
                                 ArrayOutConverter<BYTE>(ComSafeArrayOutArg(aBytes)).array());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aBytes=%zu hrc=%Rhrc\n", this, "MachineDebugger::readPhysicalMemory", ComSafeArraySize(*aBytes), hrc));
    return hrc;
}
STDMETHODIMP SessionStateChangedEventWrap::SetProcessed()
{
    LogRelFlow(("{%p} %s:enter\n", this, "SessionStateChangedEvent::setProcessed"));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setProcessed();
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "SessionStateChangedEvent::setProcessed", hrc));
    return hrc;
}
Example #21
0
STDMETHODIMP MachineDebuggerWrap::DetectOS(BSTR *aOs)
{
    LogRelFlow(("{%p} %s:enter aOs=%p\n", this, "MachineDebugger::detectOS", aOs));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aOs);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = detectOS(BSTROutConverter(aOs).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aOs=%ls hrc=%Rhrc\n", this, "MachineDebugger::detectOS", *aOs, hrc));
    return hrc;
}
STDMETHODIMP SessionStateChangedEventWrap::WaitProcessed(LONG aTimeout,
                                                         BOOL *aResult)
{
    LogRelFlow(("{%p} %s:enter aTimeout=%RI32 aResult=%p\n", this, "SessionStateChangedEvent::waitProcessed", aTimeout, aResult));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aResult);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = waitProcessed(aTimeout,
                            aResult);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aResult=%RTbool hrc=%Rhrc\n", this, "SessionStateChangedEvent::waitProcessed", *aResult, hrc));
    return hrc;
}
Example #23
0
STDMETHODIMP MachineDebuggerWrap::SetRegister(ULONG aCpuId,
                                              IN_BSTR aName,
                                              IN_BSTR aValue)
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aName=%ls aValue=%ls\n", this, "MachineDebugger::setRegister", aCpuId, aName, aValue));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = setRegister(aCpuId,
                          BSTRInConverter(aName).str(),
                          BSTRInConverter(aValue).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, "MachineDebugger::setRegister", hrc));
    return hrc;
}
STDMETHODIMP SessionStateChangedEventWrap::COMGETTER(Source)(IEventSource **aSource)
{
    LogRelFlow(("{%p} %s: enter aSource=%p\n", this, "SessionStateChangedEvent::getSource", aSource));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aSource);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getSource(ComTypeOutConverter<IEventSource>(aSource).ptr());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aSource=%p hrc=%Rhrc\n", this, "SessionStateChangedEvent::getSource", *aSource, hrc));
    return hrc;
}
Example #25
0
STDMETHODIMP MachineDebuggerWrap::DumpGuestStack(ULONG aCpuId,
                                                 BSTR *aStack)
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aStack=%p\n", this, "MachineDebugger::dumpGuestStack", aCpuId, aStack));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aStack);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = dumpGuestStack(aCpuId,
                             BSTROutConverter(aStack).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aStack=%ls hrc=%Rhrc\n", this, "MachineDebugger::dumpGuestStack", *aStack, hrc));
    return hrc;
}
STDMETHODIMP SessionStateChangedEventWrap::COMGETTER(Waitable)(BOOL *aWaitable)
{
    LogRelFlow(("{%p} %s: enter aWaitable=%p\n", this, "SessionStateChangedEvent::getWaitable", aWaitable));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aWaitable);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getWaitable(aWaitable);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aWaitable=%RTbool hrc=%Rhrc\n", this, "SessionStateChangedEvent::getWaitable", *aWaitable, hrc));
    return hrc;
}
Example #27
0
STDMETHODIMP MachineDebuggerWrap::GetStats(IN_BSTR aPattern,
                                           BOOL aWithDescriptions,
                                           BSTR *aStats)
{
    LogRelFlow(("{%p} %s:enter aPattern=%ls aWithDescriptions=%RTbool aStats=%p\n", this, "MachineDebugger::getStats", aPattern, aWithDescriptions, aStats));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aStats);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getStats(BSTRInConverter(aPattern).str(),
                       aWithDescriptions,
                       BSTROutConverter(aStats).str());
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aStats=%ls hrc=%Rhrc\n", this, "MachineDebugger::getStats", *aStats, hrc));
    return hrc;
}
Example #28
0
/* Set the HGCM parameters according to pending messages.
 * Executed under the clipboard lock.
 */
static bool vboxSvcClipboardReturnMsg (VBOXCLIPBOARDCLIENTDATA *pClient, VBOXHGCMSVCPARM paParms[])
{
    /* Message priority is taken into account. */
    if (pClient->fMsgQuit)
    {
        LogRelFlow(("vboxSvcClipboardReturnMsg: Quit\n"));
        VBoxHGCMParmUInt32Set (&paParms[0], VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT);
        VBoxHGCMParmUInt32Set (&paParms[1], 0);
        pClient->fMsgQuit = false;
    }
    else if (pClient->fMsgReadData)
    {
        LogRelFlow(("vboxSvcClipboardReturnMsg: ReadData %02X\n", pClient->u32RequestedFormat));
        VBoxHGCMParmUInt32Set (&paParms[0], VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA);
        VBoxHGCMParmUInt32Set (&paParms[1], pClient->u32RequestedFormat);
        pClient->fMsgReadData = false;
    }
    else if (pClient->fMsgFormats)
    {
        LogRelFlow(("vboxSvcClipboardReturnMsg: Formats %02X\n", pClient->u32AvailableFormats));
        VBoxHGCMParmUInt32Set (&paParms[0], VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS);
        VBoxHGCMParmUInt32Set (&paParms[1], pClient->u32AvailableFormats);
        pClient->fMsgFormats = false;
    }
    else
    {
        /* No pending messages. */
        LogRelFlow(("vboxSvcClipboardReturnMsg: no message\n"));
        return false;
    }

    /* Message information assigned. */
    return true;
}
Example #29
0
STDMETHODIMP MachineDebuggerWrap::COMGETTER(LogEnabled)(BOOL *aLogEnabled)
{
    LogRelFlow(("{%p} %s: enter aLogEnabled=%p\n", this, "MachineDebugger::getLogEnabled", aLogEnabled));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aLogEnabled);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getLogEnabled(aLogEnabled);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aLogEnabled=%RTbool hrc=%Rhrc\n", this, "MachineDebugger::getLogEnabled", *aLogEnabled, hrc));
    return hrc;
}
Example #30
0
STDMETHODIMP HostWrap::GetProcessorSpeed(ULONG aCpuId,
                                         ULONG *aSpeed)
{
    LogRelFlow(("{%p} %s:enter aCpuId=%RU32 aSpeed=%p\n", this, "Host::getProcessorSpeed", aCpuId, aSpeed));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aSpeed);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getProcessorSpeed(aCpuId,
                                aSpeed);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave aSpeed=%RU32 hrc=%Rhrc\n", this, "Host::getProcessorSpeed", *aSpeed, hrc));
    return hrc;
}