VirtualBox

Ignore:
Timestamp:
Jul 22, 2008 8:12:42 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33575
Message:

Guest properties: initial commit of new interface

File:
1 edited

Legend:

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

    r10693 r10797  
    7474#include <VBox/err.h>
    7575#include <VBox/param.h>
    76 #ifdef VBOX_WITH_INFO_SVC
    77 # include <VBox/HostServices/VBoxInfoSvc.h>
     76#ifdef VBOX_WITH_GUEST_PROPS
     77# include <VBox/HostServices/GuestPropertySvc.h>
    7878#endif
    7979
     
    26892689}
    26902690
    2691 STDMETHODIMP Machine::GetGuestProperty (INPTR BSTR aKey, BSTR *aValue)
    2692 {
    2693 #if !defined (VBOX_WITH_INFO_SVC)
     2691STDMETHODIMP Machine::GetGuestProperty (INPTR BSTR aKey, BSTR *aValue, ULONG64 *aTimestamp, BSTR *aFlags)
     2692{
     2693    if (!VALID_PTR (aKey))
     2694        return E_INVALIDARG;
     2695    if (!VALID_PTR (aValue))
     2696        return E_POINTER;
     2697    if (!VALID_PTR (aTimestamp))
     2698        return E_POINTER;
     2699    if (!VALID_PTR (aFlags))
     2700        return E_POINTER;
     2701    *aTimestamp = 0;
     2702    Bstr().cloneTo(aFlags);
     2703    return GetGuestPropertyValue (aKey, aValue);
     2704}
     2705
     2706STDMETHODIMP Machine::GetGuestPropertyValue (INPTR BSTR aKey, BSTR *aValue)
     2707{
     2708#if !defined (VBOX_WITH_GUEST_PROPS)
    26942709    return E_NOTIMPL;
    26952710#else
     
    27042719    AutoReadLock alock (this);
    27052720
    2706     using namespace svcInfo;
     2721    using namespace guestProp;
    27072722    HRESULT rc = E_FAIL;
    27082723
     
    27532768    }
    27542769    return rc;
    2755 #endif /* else !defined (VBOX_WITH_INFO_SVC) */
    2756 }
    2757 
    2758 STDMETHODIMP Machine::SetGuestProperty (INPTR BSTR aKey, INPTR BSTR aValue)
    2759 {
    2760 #if !defined (VBOX_WITH_INFO_SVC)
     2770#endif /* else !defined (VBOX_WITH_GUEST_PROPS) */
     2771}
     2772
     2773STDMETHODIMP Machine::GetGuestPropertyTimestamp (INPTR BSTR aKey, ULONG64 *aTimestamp)
     2774{
     2775    return E_NOTIMPL;
     2776}
     2777
     2778STDMETHODIMP Machine::SetGuestProperty (INPTR BSTR aKey, INPTR BSTR aValue, INPTR BSTR aFlags)
     2779{
     2780    if (!VALID_PTR (aKey))
     2781        return E_INVALIDARG;
     2782    if ((aValue != NULL) && !VALID_PTR (aValue))
     2783        return E_INVALIDARG;
     2784    if ((aFlags != NULL) && !VALID_PTR (aFlags))
     2785        return E_INVALIDARG;
     2786    return SetGuestPropertyValue (aKey, aValue);
     2787}
     2788
     2789STDMETHODIMP Machine::SetGuestPropertyValue (INPTR BSTR aKey, INPTR BSTR aValue)
     2790{
     2791#if !defined (VBOX_WITH_GUEST_PROPS)
    27612792    return E_NOTIMPL;
    27622793#else
     
    27722803    AutoWriteLock alock (this);
    27732804
    2774     using namespace svcInfo;
     2805    using namespace guestProp;
    27752806    HRESULT rc = E_FAIL;
    27762807
     
    28222853    }
    28232854    return rc;
    2824 #endif /* else !defined (VBOX_WITH_INFO_SVC) */
     2855#endif /* else !defined (VBOX_WITH_GUEST_PROPS) */
     2856}
     2857
     2858STDMETHODIMP Machine::EnumerateGuestProperties (INPTR BSTR aPattern, ComSafeArrayOut(BSTR, aKeys), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags))
     2859{
     2860    return E_NOTIMPL;
    28252861}
    28262862
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