VirtualBox

Changeset 85307 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jul 13, 2020 12:38:15 PM (5 years ago)
Author:
vboxsync
Message:

Main/comimpl.xsl,++: Try use the Utf8Str versions of the event stuff where possible. bugref:9790

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r85301 r85307  
    345345                ComPtr<IExtraDataChangedEvent> pEDCEv = aEvent;
    346346                Bstr strMachineId;
     347                HRESULT hrc = pEDCEv->COMGETTER(MachineId)(strMachineId.asOutParam());
     348                if (FAILED(hrc)) break;
     349
    347350                Bstr strKey;
    348                 Bstr strVal;
    349                 HRESULT hrc = S_OK;
    350 
    351                 hrc = pEDCEv->COMGETTER(MachineId)(strMachineId.asOutParam());
    352                 if (FAILED(hrc)) break;
    353 
    354351                hrc = pEDCEv->COMGETTER(Key)(strKey.asOutParam());
    355352                if (FAILED(hrc)) break;
    356353
     354                Bstr strVal;
    357355                hrc = pEDCEv->COMGETTER(Value)(strVal.asOutParam());
    358356                if (FAILED(hrc)) break;
     
    52245222    AssertComRCReturnRC(autoCaller.rc());
    52255223
    5226     ::FireStorageControllerChangedEvent(mEventSource, Bstr(aMachineId.toString()).raw(), Bstr(aControllerName).raw());
     5224    ::FireStorageControllerChangedEvent(mEventSource, aMachineId.toString(), aControllerName);
    52275225
    52285226    LogFlowThisFunc(("Leaving rc=%#x\n", S_OK));
     
    60656063}
    60666064
    6067 HRESULT Console::i_onExtraDataChange(IN_BSTR aMachineId, IN_BSTR aKey, IN_BSTR aVal)
     6065HRESULT Console::i_onExtraDataChange(const Bstr &aMachineId, const Bstr &aKey, const Bstr &aVal)
    60686066{
    60696067    LogFlowThisFunc(("\n"));
     
    60736071        return autoCaller.rc();
    60746072
    6075     if (!aMachineId)
     6073    if (aMachineId != i_getId())
    60766074        return S_OK;
    60776075
    6078     HRESULT hrc = S_OK;
    6079     Bstr idMachine(aMachineId);
    6080     if (   FAILED(hrc)
    6081         || idMachine != i_getId())
    6082         return hrc;
    6083 
    60846076    /* don't do anything if the VM isn't running */
    6085     SafeVMPtrQuiet ptrVM(this);
    6086     if (ptrVM.isOk())
    6087     {
    6088         if (RTUtf16CmpAscii(aKey, "VBoxInternal2/TurnResetIntoPowerOff") == 0)
    6089         {
    6090             mfTurnResetIntoPowerOff = RTUtf16CmpAscii(aVal, "1") == 0;
     6077    if (aKey == "VBoxInternal2/TurnResetIntoPowerOff")
     6078    {
     6079        SafeVMPtrQuiet ptrVM(this);
     6080        if (ptrVM.isOk())
     6081        {
     6082            mfTurnResetIntoPowerOff = aVal == "1";
    60916083            int vrc = VMR3SetPowerOffInsteadOfReset(ptrVM.rawUVM(), mfTurnResetIntoPowerOff);
    60926084            AssertRC(vrc);
    6093         }
    6094 
    6095         ptrVM.release();
     6085
     6086            ptrVM.release();
     6087        }
    60966088    }
    60976089
    60986090    /* notify console callbacks on success */
    6099     if (SUCCEEDED(hrc))
    6100         ::FireExtraDataChangedEvent(mEventSource, aMachineId, aKey, aVal);
    6101 
    6102     LogFlowThisFunc(("Leaving hrc=%#x\n", hrc));
    6103     return hrc;
     6091    ::FireExtraDataChangedEvent(mEventSource, aMachineId.raw(), aKey.raw(), aVal.raw());
     6092
     6093    LogFlowThisFunc(("Leaving S_OK\n"));
     6094    return S_OK;
    61046095}
    61056096
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r85300 r85307  
    789789        if (fDisabled)
    790790            ::FireGuestMonitorChangedEvent(mParent->i_getEventSource(),
    791                                            GuestMonitorChangedEventType_Disabled,  uScreenId, 0, 0, 0, 0);
     791                                           GuestMonitorChangedEventType_Disabled, uScreenId, 0, 0, 0, 0);
    792792        else
    793793            ::FireGuestMonitorChangedEvent(mParent->i_getEventSource(),
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r85300 r85307  
    527527
    528528                com::SafeArray<BYTE> data((size_t)cbRead);
    529                 data.initFrom((BYTE*)dataCb.u.read.pvData, cbRead);
     529                data.initFrom((BYTE *)dataCb.u.read.pvData, cbRead);
    530530
    531531                ::FireGuestFileReadEvent(mEventSource, mSession, this, mData.mOffCurrent, cbRead, ComSafeArrayAsInParam(data));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette