VirtualBox

Ignore:
Timestamp:
Oct 10, 2008 11:27:30 AM (16 years ago)
Author:
vboxsync
Message:

Main: use the HGCM guest property change notification interface and do some clean ups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r12914 r13165  
    89268926    LogFlowThisFunc (("\n"));
    89278927
     8928#ifdef VBOX_WITH_GUEST_PROPS
    89288929    AutoCaller autoCaller (this);
    89298930    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     
    89578958    mHWData->mPropertyServiceActive = true;
    89588959    return S_OK;
     8960#else
     8961    return VERR_NOT_IMPLEMENTED;
     8962#endif
    89598963}
    89608964
     
    89658969{
    89668970    LogFlowThisFunc (("\n"));
     8971
     8972#ifdef VBOX_WITH_GUEST_PROPS
    89678973    AutoCaller autoCaller (this);
    89688974    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
     
    90069012    mData->mRegistered = TRUE;
    90079013    return S_OK;
     9014#else
     9015    return VERR_NOT_IMPLEMENTED;
     9016#endif
     9017}
     9018
     9019STDMETHODIMP SessionMachine::PushGuestProperty (INPTR BSTR aName, INPTR BSTR aValue,
     9020                                                ULONG64 aTimestamp, INPTR BSTR aFlags)
     9021{
     9022    LogFlowThisFunc (("\n"));
     9023
     9024#ifdef VBOX_WITH_GUEST_PROPS
     9025    if (!VALID_PTR(aName))
     9026        return E_INVALIDARG;
     9027    if ((aValue != NULL) && (!VALID_PTR(aValue) || !VALID_PTR(aFlags)))
     9028        return E_INVALIDARG;  /* aValue can be NULL to indicate deletion */
     9029
     9030    AutoCaller autoCaller (this);
     9031    CheckComRCReturnRC (autoCaller.rc());
     9032
     9033    AutoWriteLock alock (this);
     9034
     9035    HRESULT rc = checkStateDependency (MutableStateDep);
     9036    CheckComRCReturnRC (rc);
     9037
     9038    mHWData.backup();
     9039    for (HWData::GuestPropertyList::iterator iter = mHWData->mGuestProperties.begin();
     9040         iter != mHWData->mGuestProperties.end(); ++iter)
     9041        if (aName == iter->mName)
     9042        {
     9043            mHWData->mGuestProperties.erase(iter);
     9044            break;
     9045        }
     9046    if (aValue != NULL)
     9047    {
     9048        HWData::GuestProperty property = { aName, aValue, aTimestamp, aFlags };
     9049        mHWData->mGuestProperties.push_back(property);
     9050    }
     9051
     9052    /* send a callback notification if appropriate */
     9053    alock.leave();
     9054    // doGuestPropertyCallback(aName, aValue, aFlags);
     9055
     9056    return S_OK;
     9057#else
     9058    return VERR_NOT_IMPLEMENTED;
     9059#endif
    90089060}
    90099061
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