VirtualBox

Ignore:
Timestamp:
Jul 7, 2008 10:33:33 AM (16 years ago)
Author:
vboxsync
Message:

Main: Lock the object before switching on non-const data members.

File:
1 edited

Legend:

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

    r10233 r10305  
    655655
    656656STDMETHODIMP Session::AccessGuestProperty (INPTR BSTR aKey, INPTR BSTR aValue,
    657                                            BOOL isSetter, BSTR *retValue)
     657                                           BOOL aIsSetter, BSTR *aRetValue)
    658658{
    659659#ifdef VBOX_WITH_INFO_SVC
     
    663663    if (mState != SessionState_Open)
    664664        return setError (E_FAIL,
    665                          tr ("Machine session is not open (session state: %d) - please retry."),
    666                          mState);
     665            tr ("Machine session is not open (session state: %d)."),
     666            mState);
    667667    AssertReturn (mType == SessionType_Direct, E_UNEXPECTED);
    668     if (!VALID_PTR(aKey))
     668    if (!VALID_PTR (aKey))
    669669        return E_POINTER;
    670     if (!isSetter && !VALID_PTR(retValue))
     670    if (!aIsSetter && !VALID_PTR (aRetValue))
    671671        return E_POINTER;
    672672    /* aValue can be NULL for a setter call if the property is to be deleted. */
    673     if (isSetter && (aValue != NULL) && !VALID_PTR(aValue))
    674         return E_POINTER;
    675     if (!isSetter)
    676         return mConsole->getGuestProperty(aKey, retValue);
     673    if (aIsSetter && (aValue != NULL) && !VALID_PTR (aValue))
     674        return E_INVALIDARG;
     675    if (!aIsSetter)
     676        return mConsole->getGuestProperty (aKey, aRetValue);
    677677    else
    678         return mConsole->setGuestProperty(aKey, aValue);
     678        return mConsole->setGuestProperty (aKey, aValue);
    679679#else
    680680    return E_NOTIMPL;
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