VirtualBox

Changeset 49951 in vbox


Ignore:
Timestamp:
Dec 17, 2013 11:44:22 AM (11 years ago)
Author:
vboxsync
Message:

6813 - stage 5 - Make use of server side API wrapper code in all interfaces

Location:
trunk/src/VBox/Main
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r48989 r49951  
    77
    88/*
    9  * Copyright (C) 2006-2012 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121#define ____H_NETWORKADAPTER
    2222
    23 #include "VirtualBoxBase.h"
    24 #include "NATEngineImpl.h"
    25 #include "BandwidthGroupImpl.h"
     23#include "NetworkAdapterWrap.h"
    2624
    2725class GuestOSType;
     26class BandwidthControl;
     27class BandwidthGroup;
     28class NATEngine;
    2829
    2930namespace settings
     
    3334
    3435class ATL_NO_VTABLE NetworkAdapter :
    35     public VirtualBoxBase,
    36     VBOX_SCRIPTABLE_IMPL(INetworkAdapter)
     36    public NetworkAdapterWrap
    3737{
    3838public:
     39
     40    DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
     41
     42    HRESULT FinalConstruct();
     43    void FinalRelease();
     44
     45    // public initializer/uninitializer for internal purposes only
     46    HRESULT init(Machine *aParent, ULONG aSlot);
     47    HRESULT init(Machine *aParent, NetworkAdapter *aThat, bool aReshare = false);
     48    HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
     49    void uninit();
     50
     51    // public methods only for internal purposes
     52    HRESULT i_loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
     53    HRESULT i_saveSettings(settings::NetworkAdapter &data);
     54
     55    bool i_isModified();
     56    void i_rollback();
     57    void i_commit();
     58    void i_copyFrom(NetworkAdapter *aThat);
     59    void i_applyDefaults(GuestOSType *aOsType);
     60
     61    ComObjPtr<NetworkAdapter> i_getPeer();
     62
     63private:
     64
     65    // wrapped INetworkAdapter properties
     66    HRESULT getAdapterType(NetworkAdapterType_T *aAdapterType);
     67    HRESULT setAdapterType(NetworkAdapterType_T aAdapterType);
     68    HRESULT getSlot(ULONG *aSlot);
     69    HRESULT getEnabled(BOOL *aEnabled);
     70    HRESULT setEnabled(BOOL aEnabled);
     71    HRESULT getMACAddress(com::Utf8Str &aMACAddress);
     72    HRESULT setMACAddress(const com::Utf8Str &aMACAddress);
     73    HRESULT getAttachmentType(NetworkAttachmentType_T *aAttachmentType);
     74    HRESULT setAttachmentType(NetworkAttachmentType_T aAttachmentType);
     75    HRESULT getBridgedInterface(com::Utf8Str &aBridgedInterface);
     76    HRESULT setBridgedInterface(const com::Utf8Str &aBridgedInterface);
     77    HRESULT getHostOnlyInterface(com::Utf8Str &aHostOnlyInterface);
     78    HRESULT setHostOnlyInterface(const com::Utf8Str &aHostOnlyInterface);
     79    HRESULT getInternalNetwork(com::Utf8Str &aInternalNetwork);
     80    HRESULT setInternalNetwork(const com::Utf8Str &aInternalNetwork);
     81    HRESULT getNATNetwork(com::Utf8Str &aNATNetwork);
     82    HRESULT setNATNetwork(const com::Utf8Str &aNATNetwork);
     83    HRESULT getGenericDriver(com::Utf8Str &aGenericDriver);
     84    HRESULT setGenericDriver(const com::Utf8Str &aGenericDriver);
     85    HRESULT getCableConnected(BOOL *aCableConnected);
     86    HRESULT setCableConnected(BOOL aCableConnected);
     87    HRESULT getLineSpeed(ULONG *aLineSpeed);
     88    HRESULT setLineSpeed(ULONG aLineSpeed);
     89    HRESULT getPromiscModePolicy(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
     90    HRESULT setPromiscModePolicy(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
     91    HRESULT getTraceEnabled(BOOL *aTraceEnabled);
     92    HRESULT setTraceEnabled(BOOL aTraceEnabled);
     93    HRESULT getTraceFile(com::Utf8Str &aTraceFile);
     94    HRESULT setTraceFile(const com::Utf8Str &aTraceFile);
     95    HRESULT getNATEngine(ComPtr<INATEngine> &aNATEngine);
     96    HRESULT getBootPriority(ULONG *aBootPriority);
     97    HRESULT setBootPriority(ULONG aBootPriority);
     98    HRESULT getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup);
     99    HRESULT setBandwidthGroup(const ComPtr<IBandwidthGroup> &aBandwidthGroup);
     100
     101    // wrapped INetworkAdapter methods
     102    HRESULT getProperty(const com::Utf8Str &aKey,
     103                        com::Utf8Str &aValue);
     104    HRESULT setProperty(const com::Utf8Str &aKey,
     105                        const com::Utf8Str &aValue);
     106    HRESULT getProperties(const com::Utf8Str &aNames,
     107                          std::vector<com::Utf8Str> &aReturnNames,
     108                          std::vector<com::Utf8Str> &aReturnValues);
     109    // Misc.
     110    void i_generateMACAddress();
     111    HRESULT i_updateMacAddress(Utf8Str aMacAddress);
     112    void i_updateBandwidthGroup(BandwidthGroup *aBwGroup);
     113    HRESULT i_checkAndSwitchFromNatNetworking(com::Utf8Str networkName);
     114    HRESULT i_switchToNatNetworking(const com::Utf8Str &aNatNetworkName);
     115
     116    typedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
    39117
    40118    struct Data
     
    56134        ULONG mSlot;
    57135        BOOL mEnabled;
    58         Bstr mMACAddress;
     136        com::Utf8Str mMACAddress;
    59137        NetworkAttachmentType_T mAttachmentType;
    60138        BOOL mCableConnected;
     
    62140        NetworkAdapterPromiscModePolicy_T mPromiscModePolicy;
    63141        BOOL mTraceEnabled;
    64         Bstr mTraceFile;
    65         Bstr mBridgedInterface;
    66         Bstr mHostOnlyInterface;
    67         Bstr mInternalNetwork;
    68         Bstr mNATNetwork;
    69         Bstr mGenericDriver;
    70         settings::StringsMap mGenericProperties;
     142        com::Utf8Str mTraceFile;
     143        com::Utf8Str mBridgedInterface;
     144        com::Utf8Str mHostOnlyInterface;
     145        com::Utf8Str mInternalNetwork;
     146        com::Utf8Str mNATNetwork;
     147        com::Utf8Str mGenericDriver;
     148        StringsMap mGenericProperties;
    71149        ULONG mBootPriority;
    72         Utf8Str mBandwidthGroup;
     150        com::Utf8Str mBandwidthGroup;
    73151    };
    74 
    75     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(NetworkAdapter, INetworkAdapter)
    76 
    77     DECLARE_NOT_AGGREGATABLE(NetworkAdapter)
    78 
    79     DECLARE_PROTECT_FINAL_CONSTRUCT()
    80 
    81     BEGIN_COM_MAP(NetworkAdapter)
    82         VBOX_DEFAULT_INTERFACE_ENTRIES(INetworkAdapter)
    83     END_COM_MAP()
    84 
    85     DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
    86 
    87     HRESULT FinalConstruct();
    88     void FinalRelease();
    89 
    90     // public initializer/uninitializer for internal purposes only
    91     HRESULT init(Machine *aParent, ULONG aSlot);
    92     HRESULT init(Machine *aParent, NetworkAdapter *aThat, bool aReshare = false);
    93     HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
    94     void uninit();
    95 
    96     // INetworkAdapter properties
    97     STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aAdapterType);
    98     STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T aAdapterType);
    99     STDMETHOD(COMGETTER(Slot))(ULONG *aSlot);
    100     STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
    101     STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
    102     STDMETHOD(COMGETTER(MACAddress))(BSTR *aMACAddress);
    103     STDMETHOD(COMSETTER(MACAddress))(IN_BSTR aMACAddress);
    104     STDMETHOD(COMGETTER(AttachmentType))(NetworkAttachmentType_T *aAttachmentType);
    105     STDMETHOD(COMSETTER(AttachmentType))(NetworkAttachmentType_T aAttachmentType);
    106     STDMETHOD(COMGETTER(BridgedInterface))(BSTR *aBridgedInterface);
    107     STDMETHOD(COMSETTER(BridgedInterface))(IN_BSTR aBridgedInterface);
    108     STDMETHOD(COMGETTER(HostOnlyInterface))(BSTR *aHostOnlyInterface);
    109     STDMETHOD(COMSETTER(HostOnlyInterface))(IN_BSTR aHostOnlyInterface);
    110     STDMETHOD(COMGETTER(InternalNetwork))(BSTR *aInternalNetwork);
    111     STDMETHOD(COMSETTER(InternalNetwork))(IN_BSTR aInternalNetwork);
    112     STDMETHOD(COMGETTER(NATNetwork))(BSTR *aNATNetwork);
    113     STDMETHOD(COMSETTER(NATNetwork))(IN_BSTR aNATNetwork);
    114     STDMETHOD(COMGETTER(GenericDriver))(BSTR *aGenericDriver);
    115     STDMETHOD(COMSETTER(GenericDriver))(IN_BSTR aGenericDriver);
    116     STDMETHOD(COMGETTER(CableConnected))(BOOL *aConnected);
    117     STDMETHOD(COMSETTER(CableConnected))(BOOL aConnected);
    118     STDMETHOD(COMGETTER(TraceEnabled))(BOOL *aEnabled);
    119     STDMETHOD(COMSETTER(TraceEnabled))(BOOL aEnabled);
    120     STDMETHOD(COMGETTER(LineSpeed))(ULONG *aSpeed);
    121     STDMETHOD(COMSETTER(LineSpeed))(ULONG aSpeed);
    122     STDMETHOD(COMGETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
    123     STDMETHOD(COMSETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
    124     STDMETHOD(COMGETTER(TraceFile))(BSTR *aTraceFile);
    125     STDMETHOD(COMSETTER(TraceFile))(IN_BSTR aTraceFile);
    126     STDMETHOD(COMGETTER(NATEngine))(INATEngine **aNATEngine);
    127     STDMETHOD(COMGETTER(BootPriority))(ULONG *aBootPriority);
    128     STDMETHOD(COMSETTER(BootPriority))(ULONG aBootPriority);
    129     STDMETHOD(COMGETTER(BandwidthGroup))(IBandwidthGroup **aBwGroup);
    130     STDMETHOD(COMSETTER(BandwidthGroup))(IBandwidthGroup *aBwGroup);
    131 
    132     // INetworkAdapter methods
    133     STDMETHOD(GetProperty)(IN_BSTR aName, BSTR *aValue);
    134     STDMETHOD(SetProperty)(IN_BSTR aName, IN_BSTR aValue);
    135     STDMETHOD(GetProperties)(IN_BSTR aNames,
    136                              ComSafeArrayOut(BSTR, aReturnNames),
    137                              ComSafeArrayOut(BSTR, aReturnValues));
    138 
    139     // public methods only for internal purposes
    140 
    141     HRESULT loadSettings(BandwidthControl *bwctl, const settings::NetworkAdapter &data);
    142     HRESULT saveSettings(settings::NetworkAdapter &data);
    143 
    144     bool isModified();
    145     void rollback();
    146     void commit();
    147     void copyFrom(NetworkAdapter *aThat);
    148     void applyDefaults(GuestOSType *aOsType);
    149 
    150     ComObjPtr<NetworkAdapter> getPeer();
    151 
    152 private:
    153 
    154     void generateMACAddress();
    155     HRESULT updateMacAddress(Utf8Str aMacAddress);
    156     void updateBandwidthGroup(BandwidthGroup *aBwGroup);
    157     HRESULT checkAndSwitchFromNatNetworking(IN_BSTR aNatNetworkName);
    158     HRESULT switchToNatNetworking(IN_BSTR aNatNetworkName);
    159152
    160153    Machine * const     mParent;
  • trunk/src/VBox/Main/include/SystemPropertiesImpl.h

    r47991 r49951  
    2121#define ____H_SYSTEMPROPERTIESIMPL
    2222
    23 #include "VirtualBoxBase.h"
    2423#include "MediumFormatImpl.h"
     24#include "SystemPropertiesWrap.h"
    2525
    26 #include <VBox/com/array.h>
    27 
    28 #include <list>
    2926
    3027namespace settings
     
    3431
    3532class ATL_NO_VTABLE SystemProperties :
    36     public VirtualBoxBase,
    37     VBOX_SCRIPTABLE_IMPL(ISystemProperties)
     33    public SystemPropertiesWrap
    3834{
    3935public:
    40 
    41     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SystemProperties, ISystemProperties)
    42 
    43     DECLARE_NOT_AGGREGATABLE(SystemProperties)
    44 
    45     DECLARE_PROTECT_FINAL_CONSTRUCT()
    46 
    47     BEGIN_COM_MAP(SystemProperties)
    48         VBOX_DEFAULT_INTERFACE_ENTRIES(ISystemProperties)
    49     END_COM_MAP()
     36    typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
    5037
    5138    DECLARE_EMPTY_CTOR_DTOR(SystemProperties)
     
    5845    void uninit();
    5946
    60     // ISystemProperties properties
    61     STDMETHOD(COMGETTER(MinGuestRAM))(ULONG *minRAM);
    62     STDMETHOD(COMGETTER(MaxGuestRAM))(ULONG *maxRAM);
    63     STDMETHOD(COMGETTER(MinGuestVRAM))(ULONG *minVRAM);
    64     STDMETHOD(COMGETTER(MaxGuestVRAM))(ULONG *maxVRAM);
    65     STDMETHOD(COMGETTER(MinGuestCPUCount))(ULONG *minCPUCount);
    66     STDMETHOD(COMGETTER(MaxGuestCPUCount))(ULONG *maxCPUCount);
    67     STDMETHOD(COMGETTER(MaxGuestMonitors))(ULONG *maxMonitors);
    68     STDMETHOD(COMGETTER(InfoVDSize))(LONG64 *infoVDSize);
    69     STDMETHOD(COMGETTER(SerialPortCount))(ULONG *count);
    70     STDMETHOD(COMGETTER(ParallelPortCount))(ULONG *count);
    71     STDMETHOD(COMGETTER(MaxBootPosition))(ULONG *aMaxBootPosition);
    72     STDMETHOD(COMGETTER(ExclusiveHwVirt))(BOOL *aExclusiveHwVirt);
    73     STDMETHOD(COMSETTER(ExclusiveHwVirt))(BOOL aExclusiveHwVirt);
    74     STDMETHOD(COMGETTER(LoggingLevel))(BSTR *aLoggingLevel);
    75     STDMETHOD(COMSETTER(LoggingLevel))(IN_BSTR aLoggingLevel);
    76     STDMETHOD(COMGETTER(DefaultMachineFolder))(BSTR *aDefaultMachineFolder);
    77     STDMETHOD(COMSETTER(DefaultMachineFolder))(IN_BSTR aDefaultMachineFolder);
    78     STDMETHOD(COMGETTER(MediumFormats))(ComSafeArrayOut(IMediumFormat *, aMediumFormats));
    79     STDMETHOD(COMGETTER(DefaultHardDiskFormat))(BSTR *aDefaultHardDiskFormat);
    80     STDMETHOD(COMSETTER(DefaultHardDiskFormat))(IN_BSTR aDefaultHardDiskFormat);
    81     STDMETHOD(COMGETTER(FreeDiskSpaceWarning))(LONG64 *aFreeDiskSpace);
    82     STDMETHOD(COMSETTER(FreeDiskSpaceWarning))(LONG64 aFreeDiskSpace);
    83     STDMETHOD(COMGETTER(FreeDiskSpacePercentWarning))(ULONG *aFreeDiskSpacePercent);
    84     STDMETHOD(COMSETTER(FreeDiskSpacePercentWarning))(ULONG aFreeDiskSpacePercent);
    85     STDMETHOD(COMGETTER(FreeDiskSpaceError))(LONG64 *aFreeDiskSpace);
    86     STDMETHOD(COMSETTER(FreeDiskSpaceError))(LONG64 aFreeDiskSpace);
    87     STDMETHOD(COMGETTER(FreeDiskSpacePercentError))(ULONG *aFreeDiskSpacePercent);
    88     STDMETHOD(COMSETTER(FreeDiskSpacePercentError))(ULONG aFreeDiskSpacePercent);
    89     STDMETHOD(COMGETTER(VRDEAuthLibrary))(BSTR *aVRDEAuthLibrary);
    90     STDMETHOD(COMSETTER(VRDEAuthLibrary))(IN_BSTR aVRDEAuthLibrary);
    91     STDMETHOD(COMGETTER(WebServiceAuthLibrary))(BSTR *aWebServiceAuthLibrary);
    92     STDMETHOD(COMSETTER(WebServiceAuthLibrary))(IN_BSTR aWebServiceAuthLibrary);
    93     STDMETHOD(COMGETTER(DefaultVRDEExtPack))(BSTR *aExtPack);
    94     STDMETHOD(COMSETTER(DefaultVRDEExtPack))(IN_BSTR aExtPack);
    95     STDMETHOD(COMGETTER(LogHistoryCount))(ULONG *count);
    96     STDMETHOD(COMSETTER(LogHistoryCount))(ULONG count);
    97     STDMETHOD(COMGETTER(DefaultAudioDriver))(AudioDriverType_T *aAudioDriver);
    98     STDMETHOD(COMGETTER(AutostartDatabasePath))(BSTR *aAutostartDbPath);
    99     STDMETHOD(COMSETTER(AutostartDatabasePath))(IN_BSTR aAutostartDbPath);
    100     STDMETHOD(COMGETTER(DefaultAdditionsISO))(BSTR *aDefaultAdditionsISO);
    101     STDMETHOD(COMSETTER(DefaultAdditionsISO))(IN_BSTR aDefaultAdditionsISO);
    102     STDMETHOD(COMGETTER(DefaultFrontend))(BSTR *aDefaultFrontend);
    103     STDMETHOD(COMSETTER(DefaultFrontend))(IN_BSTR aDefaultFrontend);
    104 
    105     STDMETHOD(GetMaxNetworkAdapters)(ChipsetType_T aChipset, ULONG *aMaxInstances);
    106     STDMETHOD(GetMaxNetworkAdaptersOfType)(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *aMaxInstances);
    107     STDMETHOD(GetMaxDevicesPerPortForStorageBus)(StorageBus_T aBus, ULONG *aMaxDevicesPerPort);
    108     STDMETHOD(GetMinPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMinPortCount);
    109     STDMETHOD(GetMaxPortCountForStorageBus)(StorageBus_T aBus, ULONG *aMaxPortCount);
    110     STDMETHOD(GetMaxInstancesOfStorageBus)(ChipsetType_T aChipset, StorageBus_T aBus, ULONG *aMaxInstances);
    111     STDMETHOD(GetDeviceTypesForStorageBus)(StorageBus_T aBus, ComSafeArrayOut(DeviceType_T, aDeviceTypes));
    112     STDMETHOD(GetDefaultIoCacheSettingForStorageController)(StorageControllerType_T aControllerType, BOOL *aEnabled);
    113     STDMETHOD(GetMaxInstancesOfUSBControllerType)(ChipsetType_T aChipset, USBControllerType_T aType, ULONG *aMaxInstances);
    114 
    115     // public methods only for internal purposes
    116 
    117     HRESULT loadSettings(const settings::SystemProperties &data);
    118     HRESULT saveSettings(settings::SystemProperties &data);
    119 
    120     ComObjPtr<MediumFormat> mediumFormat(const Utf8Str &aFormat);
    121     ComObjPtr<MediumFormat> mediumFormatFromExtension(const Utf8Str &aExt);
    122 
    12347    // public methods for internal purposes only
    12448    // (ensure there is a caller and a read lock before calling them!)
     49    HRESULT i_loadSettings(const settings::SystemProperties &data);
     50    HRESULT i_saveSettings(settings::SystemProperties &data);
     51
     52    ComObjPtr<MediumFormat> i_mediumFormat(const Utf8Str &aFormat);
     53    ComObjPtr<MediumFormat> i_mediumFormatFromExtension(const Utf8Str &aExt);
    12554
    12655private:
    12756
    128     typedef std::list<ComObjPtr<MediumFormat> > MediumFormatList;
     57    // wrapped ISystemProperties properties
     58    HRESULT getMinGuestRAM(ULONG *aMinGuestRAM);
     59    HRESULT getMaxGuestRAM(ULONG *aMaxGuestRAM);
     60    HRESULT getMinGuestVRAM(ULONG *aMinGuestVRAM);
     61    HRESULT getMaxGuestVRAM(ULONG *aMaxGuestVRAM);
     62    HRESULT getMinGuestCPUCount(ULONG *aMinGuestCPUCount);
     63    HRESULT getMaxGuestCPUCount(ULONG *aMaxGuestCPUCount);
     64    HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors);
     65    HRESULT getInfoVDSize(LONG64 *aInfoVDSize);
     66    HRESULT getSerialPortCount(ULONG *aSerialPortCount);
     67    HRESULT getParallelPortCount(ULONG *aParallelPortCount);
     68    HRESULT getMaxBootPosition(ULONG *aMaxBootPosition);
     69    HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt);
     70    HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt);
     71    HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder);
     72    HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder);
     73    HRESULT getLoggingLevel(com::Utf8Str &aLoggingLevel);
     74    HRESULT setLoggingLevel(const com::Utf8Str &aLoggingLevel);
     75    HRESULT getMediumFormats(std::vector<ComPtr<IMediumFormat> > &aMediumFormats);
     76    HRESULT getDefaultHardDiskFormat(com::Utf8Str &aDefaultHardDiskFormat);
     77    HRESULT setDefaultHardDiskFormat(const com::Utf8Str &aDefaultHardDiskFormat);
     78    HRESULT getFreeDiskSpaceWarning(LONG64 *aFreeDiskSpaceWarning);
     79    HRESULT setFreeDiskSpaceWarning(LONG64 aFreeDiskSpaceWarning);
     80    HRESULT getFreeDiskSpacePercentWarning(ULONG *aFreeDiskSpacePercentWarning);
     81    HRESULT setFreeDiskSpacePercentWarning(ULONG aFreeDiskSpacePercentWarning);
     82    HRESULT getFreeDiskSpaceError(LONG64 *aFreeDiskSpaceError);
     83    HRESULT setFreeDiskSpaceError(LONG64 aFreeDiskSpaceError);
     84    HRESULT getFreeDiskSpacePercentError(ULONG *aFreeDiskSpacePercentError);
     85    HRESULT setFreeDiskSpacePercentError(ULONG aFreeDiskSpacePercentError);
     86    HRESULT getVRDEAuthLibrary(com::Utf8Str &aVRDEAuthLibrary);
     87    HRESULT setVRDEAuthLibrary(const com::Utf8Str &aVRDEAuthLibrary);
     88    HRESULT getWebServiceAuthLibrary(com::Utf8Str &aWebServiceAuthLibrary);
     89    HRESULT setWebServiceAuthLibrary(const com::Utf8Str &aWebServiceAuthLibrary);
     90    HRESULT getDefaultVRDEExtPack(com::Utf8Str &aDefaultVRDEExtPack);
     91    HRESULT setDefaultVRDEExtPack(const com::Utf8Str &aDefaultVRDEExtPack);
     92    HRESULT getLogHistoryCount(ULONG *aLogHistoryCount);
     93    HRESULT setLogHistoryCount(ULONG aLogHistoryCount);
     94    HRESULT getDefaultAudioDriver(AudioDriverType_T *aDefaultAudioDriver);
     95    HRESULT getAutostartDatabasePath(com::Utf8Str &aAutostartDatabasePath);
     96    HRESULT setAutostartDatabasePath(const com::Utf8Str &aAutostartDatabasePath);
     97    HRESULT getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO);
     98    HRESULT setDefaultAdditionsISO(const com::Utf8Str &aDefaultAdditionsISO);
     99    HRESULT getDefaultFrontend(com::Utf8Str &aDefaultFrontend);
     100    HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
    129101
    130     HRESULT getUserHomeDirectory(Utf8Str &strPath);
    131     HRESULT setDefaultMachineFolder(const Utf8Str &aPath);
    132     HRESULT setLoggingLevel(const Utf8Str &aLoggingLevel);
    133     HRESULT setDefaultHardDiskFormat(const Utf8Str &aFormat);
     102    // wrapped ISystemProperties methods
     103    HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,
     104                                  ULONG *aMaxNetworkAdapters);
     105    HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,
     106                                        NetworkAttachmentType_T aType,
     107                                        ULONG *aMaxNetworkAdapters);
     108    HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
     109                                              ULONG *aMaxDevicesPerPort);
     110    HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,
     111                                         ULONG *aMinPortCount);
     112    HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,
     113                                         ULONG *aMaxPortCount);
     114    HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
     115                                        StorageBus_T aBus,
     116                                        ULONG *aMaxInstances);
     117    HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,
     118                                        std::vector<DeviceType_T> &aDeviceTypes);
     119    HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
     120                                                         BOOL *aEnabled);
     121    HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
     122                                               USBControllerType_T aType,
     123                                               ULONG *aMaxInstances);
    134124
    135     HRESULT setVRDEAuthLibrary(const Utf8Str &aPath);
    136     HRESULT setWebServiceAuthLibrary(const Utf8Str &aPath);
    137     HRESULT setDefaultVRDEExtPack(const Utf8Str &aPath);
    138     HRESULT setAutostartDatabasePath(const Utf8Str &aPath);
    139     HRESULT setDefaultAdditionsISO(const Utf8Str &aPath);
    140     HRESULT setDefaultFrontend(const Utf8Str &aPath);
     125    HRESULT i_getUserHomeDirectory(Utf8Str &strPath);
     126    HRESULT i_setDefaultMachineFolder(const Utf8Str &strPath);
     127    HRESULT i_setLoggingLevel(const com::Utf8Str &aLoggingLevel);
     128    HRESULT i_setDefaultHardDiskFormat(const com::Utf8Str &aFormat);
     129    HRESULT i_setVRDEAuthLibrary(const com::Utf8Str &aPath);
     130
     131    HRESULT i_setWebServiceAuthLibrary(const com::Utf8Str &aPath);
     132    HRESULT i_setDefaultVRDEExtPack(const com::Utf8Str &aExtPack);
     133    HRESULT i_setAutostartDatabasePath(const com::Utf8Str &aPath);
     134    HRESULT i_setDefaultAdditionsISO(const com::Utf8Str &aPath);
     135    HRESULT i_setDefaultFrontend(const com::Utf8Str &aDefaultFrontend);
    141136
    142137    VirtualBox * const  mParent;
     
    144139    settings::SystemProperties *m;
    145140
    146     MediumFormatList    m_llMediumFormats;
     141    MediumFormatList m_llMediumFormats;
    147142
    148143    friend class VirtualBox;
  • trunk/src/VBox/Main/include/USBDeviceFilterImpl.h

    r47376 r49951  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1919#define ____H_USBDEVICEFILTERIMPL
    2020
    21 #include "VirtualBoxBase.h"
    22 
    2321#include "Matching.h"
    2422#include <VBox/usbfilter.h>
     23#include "USBDeviceFilterWrap.h"
    2524
    2625class USBDeviceFilters;
     
    3534
    3635class ATL_NO_VTABLE USBDeviceFilter :
    37     public VirtualBoxBase,
    38     VBOX_SCRIPTABLE_IMPL(IUSBDeviceFilter)
     36    public USBDeviceFilterWrap
    3937{
    4038public:
     
    6765    };
    6866
    69     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(USBDeviceFilter, IUSBDeviceFilter)
    70 
    71     DECLARE_NOT_AGGREGATABLE(USBDeviceFilter)
    72 
    73     DECLARE_PROTECT_FINAL_CONSTRUCT()
    74 
    75     BEGIN_COM_MAP(USBDeviceFilter)
    76         VBOX_DEFAULT_INTERFACE_ENTRIES  (IUSBDeviceFilter)
    77     END_COM_MAP()
    78 
    79     DECLARE_EMPTY_CTOR_DTOR (USBDeviceFilter)
     67    DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilter)
    8068
    8169    HRESULT FinalConstruct();
     
    9179    void uninit();
    9280
    93     // IUSBDeviceFilter properties
    94     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    95     STDMETHOD(COMSETTER(Name)) (IN_BSTR aName);
    96     STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
    97     STDMETHOD(COMSETTER(Active)) (BOOL aActive);
    98     STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
    99     STDMETHOD(COMSETTER(VendorId)) (IN_BSTR aVendorId);
    100     STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
    101     STDMETHOD(COMSETTER(ProductId)) (IN_BSTR aProductId);
    102     STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
    103     STDMETHOD(COMSETTER(Revision)) (IN_BSTR aRevision);
    104     STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
    105     STDMETHOD(COMSETTER(Manufacturer)) (IN_BSTR aManufacturer);
    106     STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
    107     STDMETHOD(COMSETTER(Product)) (IN_BSTR aProduct);
    108     STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
    109     STDMETHOD(COMSETTER(SerialNumber)) (IN_BSTR aSerialNumber);
    110     STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
    111     STDMETHOD(COMSETTER(Port)) (IN_BSTR aPort);
    112     STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
    113     STDMETHOD(COMSETTER(Remote)) (IN_BSTR aRemote);
    114     STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
    115     STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
    116 
    11781    // public methods only for internal purposes
    118     bool isModified();
    119     void rollback();
    120     void commit();
     82    bool i_isModified();
     83    void i_rollback();
     84    void i_commit();
    12185
    12286    void unshare();
     
    12488    // public methods for internal purposes only
    12589    // (ensure there is a caller and a read lock before calling them!)
    126 
    127     void *& getId() { return mData.data()->mId; }
    128 
    129     const Data& getData() { return *mData.data(); }
    130     ComObjPtr<USBDeviceFilter> peer() { return mPeer; }
     90    void *& i_getId() { return mData.data()->mId; }
     91    const Data& i_getData() { return *mData.data(); }
     92    ComObjPtr<USBDeviceFilter> i_peer() { return mPeer; }
    13193
    13294    // tr() wants to belong to a class it seems, thus this one here.
    133     static HRESULT usbFilterFieldFromString(PUSBFILTER aFilter,
    134                                             USBFILTERIDX aIdx,
    135                                             const Utf8Str &aValue,
    136                                             Utf8Str &aErrStr);
    137 
    138     static const char* describeUSBFilterIdx(USBFILTERIDX aIdx);
     95    static HRESULT i_usbFilterFieldFromString(PUSBFILTER aFilter,
     96                                              USBFILTERIDX aIdx,
     97                                              const Utf8Str &aValue,
     98                                              Utf8Str &aErrStr);
     99
     100    static const char* i_describeUSBFilterIdx(USBFILTERIDX aIdx);
    139101
    140102private:
    141     HRESULT usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr);
    142     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, IN_BSTR aStr);
    143     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, const Utf8Str &strNew);
     103
     104    // wrapped IUSBDeviceFilter properties
     105    HRESULT getName(com::Utf8Str &aName);
     106    HRESULT setName(const com::Utf8Str &aName);
     107    HRESULT getActive(BOOL *aActive);
     108    HRESULT setActive(BOOL aActive);
     109    HRESULT getVendorId(com::Utf8Str &aVendorId);
     110    HRESULT setVendorId(const com::Utf8Str &aVendorId);
     111    HRESULT getProductId(com::Utf8Str &aProductId);
     112    HRESULT setProductId(const com::Utf8Str &aProductId);
     113    HRESULT getRevision(com::Utf8Str &aRevision);
     114    HRESULT setRevision(const com::Utf8Str &aRevision);
     115    HRESULT getManufacturer(com::Utf8Str &aManufacturer);
     116    HRESULT setManufacturer(const com::Utf8Str &aManufacturer);
     117    HRESULT getProduct(com::Utf8Str &aProduct);
     118    HRESULT setProduct(const com::Utf8Str &aProduct);
     119    HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
     120    HRESULT setSerialNumber(const com::Utf8Str &aSerialNumber);
     121    HRESULT getPort(com::Utf8Str &aPort);
     122    HRESULT setPort(const com::Utf8Str &aPort);
     123    HRESULT getRemote(com::Utf8Str &aRemote);
     124    HRESULT setRemote(const com::Utf8Str &aRemote);
     125    HRESULT getMaskedInterfaces(ULONG *aMaskedInterfaces);
     126    HRESULT setMaskedInterfaces(ULONG aMaskedInterfaces);
     127
     128    // wrapped IUSBDeviceFilter methods
     129    HRESULT i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr);
     130    HRESULT i_usbFilterFieldSetter(USBFILTERIDX aIdx, const com::Utf8Str &strNew);
    144131
    145132    USBDeviceFilters * const     mParent;
     
    156143    friend class USBDeviceFilters;
    157144};
     145#include "HostUSBDeviceFilterWrap.h"
    158146
    159147// HostUSBDeviceFilter
     
    161149
    162150class ATL_NO_VTABLE HostUSBDeviceFilter :
    163     public VirtualBoxBase,
    164     VBOX_SCRIPTABLE_IMPL(IHostUSBDeviceFilter)
     151    public HostUSBDeviceFilterWrap
    165152{
    166153public:
     
    170157        Data() {}
    171158    };
    172 
    173     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(HostUSBDeviceFilter, IHostUSBDeviceFilter)
    174 
    175     DECLARE_NOT_AGGREGATABLE(HostUSBDeviceFilter)
    176 
    177     DECLARE_PROTECT_FINAL_CONSTRUCT()
    178 
    179     BEGIN_COM_MAP(HostUSBDeviceFilter)
    180         COM_INTERFACE_ENTRY(IUSBDeviceFilter)
    181         VBOX_DEFAULT_INTERFACE_ENTRIES(IHostUSBDeviceFilter)
    182     END_COM_MAP()
    183159
    184160    DECLARE_EMPTY_CTOR_DTOR (HostUSBDeviceFilter)
     
    193169    void uninit();
    194170
    195     // IUSBDeviceFilter properties
    196     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    197     STDMETHOD(COMSETTER(Name)) (IN_BSTR aName);
    198     STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
    199     STDMETHOD(COMSETTER(Active)) (BOOL aActive);
    200     STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
    201     STDMETHOD(COMSETTER(VendorId)) (IN_BSTR aVendorId);
    202     STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
    203     STDMETHOD(COMSETTER(ProductId)) (IN_BSTR aProductId);
    204     STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
    205     STDMETHOD(COMSETTER(Revision)) (IN_BSTR aRevision);
    206     STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
    207     STDMETHOD(COMSETTER(Manufacturer)) (IN_BSTR aManufacturer);
    208     STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
    209     STDMETHOD(COMSETTER(Product)) (IN_BSTR aProduct);
    210     STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
    211     STDMETHOD(COMSETTER(SerialNumber)) (IN_BSTR aSerialNumber);
    212     STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
    213     STDMETHOD(COMSETTER(Port)) (IN_BSTR aPort);
    214     STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
    215     STDMETHOD(COMSETTER(Remote)) (IN_BSTR aRemote);
    216     STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
    217     STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
    218 
    219     // IHostUSBDeviceFilter properties
    220     STDMETHOD(COMGETTER(Action)) (USBDeviceFilterAction_T *aAction);
    221     STDMETHOD(COMSETTER(Action)) (USBDeviceFilterAction_T aAction);
    222 
    223171    // public methods for internal purposes only
    224172    // (ensure there is a caller and a read lock before calling them!)
    225     void saveSettings(settings::USBDeviceFilter &data);
    226 
    227     void*& getId() { return mData.data()->mId; }
    228 
    229     const Data& getData() { return *mData.data(); }
     173    void i_saveSettings(settings::USBDeviceFilter &data);
     174
     175    void*& i_getId() { return mData.data()->mId; }
     176
     177    const Data& i_getData() { return *mData.data(); }
    230178
    231179    // util::Lockable interface
    232     RWLockHandle *lockHandle() const;
     180    RWLockHandle *i_lockHandle() const;
    233181
    234182private:
    235     HRESULT usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr);
    236     HRESULT usbFilterFieldSetter(USBFILTERIDX aIdx, Bstr aStr);
     183
     184    // wrapped IHostUSBDeviceFilter properties
     185    HRESULT getName(com::Utf8Str &aName);
     186    HRESULT setName(const com::Utf8Str &aName);
     187    HRESULT getActive(BOOL *aActive);
     188    HRESULT setActive(BOOL aActive);
     189    HRESULT getVendorId(com::Utf8Str &aVendorId);
     190    HRESULT setVendorId(const com::Utf8Str &aVendorId);
     191    HRESULT getProductId(com::Utf8Str &aProductId);
     192    HRESULT setProductId(const com::Utf8Str &aProductId);
     193    HRESULT getRevision(com::Utf8Str &aRevision);
     194    HRESULT setRevision(const com::Utf8Str &aRevision);
     195    HRESULT getManufacturer(com::Utf8Str &aManufacturer);
     196    HRESULT setManufacturer(const com::Utf8Str &aManufacturer);
     197    HRESULT getProduct(com::Utf8Str &aProduct);
     198    HRESULT setProduct(const com::Utf8Str &aProduct);
     199    HRESULT getSerialNumber(com::Utf8Str &aSerialNumber);
     200    HRESULT setSerialNumber(const com::Utf8Str &aSerialNumber);
     201    HRESULT getPort(com::Utf8Str &aPort);
     202    HRESULT setPort(const com::Utf8Str &aPort);
     203    HRESULT getRemote(com::Utf8Str &aRemote);
     204    HRESULT setRemote(const com::Utf8Str &aRemote);
     205    HRESULT getMaskedInterfaces(ULONG *aMaskedInterfaces);
     206    HRESULT setMaskedInterfaces(ULONG aMaskedInterfaces);
     207
     208    // wrapped IHostUSBDeviceFilter properties
     209    HRESULT getAction(USBDeviceFilterAction_T *aAction);
     210    HRESULT setAction(USBDeviceFilterAction_T aAction);
     211
     212    HRESULT i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr);
     213    HRESULT i_usbFilterFieldSetter(USBFILTERIDX aIdx, const com::Utf8Str &aStr);
    237214
    238215    Host * const        mParent;
  • trunk/src/VBox/Main/include/USBDeviceFiltersImpl.h

    r47401 r49951  
    2121#define ____H_USBDEVICEFILTERSIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "USBDeviceFiltersWrap.h"
    2424
    2525class HostUSBDevice;
     
    3232
    3333class ATL_NO_VTABLE USBDeviceFilters :
    34     public VirtualBoxBase,
    35     VBOX_SCRIPTABLE_IMPL(IUSBDeviceFilters)
     34    public USBDeviceFiltersWrap
    3635{
    3736public:
    38     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(USBDeviceFilters, IUSBDeviceFilters)
    39 
    40     DECLARE_NOT_AGGREGATABLE(USBDeviceFilters)
    41 
    42     DECLARE_PROTECT_FINAL_CONSTRUCT()
    43 
    44     BEGIN_COM_MAP(USBDeviceFilters)
    45         VBOX_DEFAULT_INTERFACE_ENTRIES(IUSBDeviceFilters)
    46     END_COM_MAP()
    4737
    4838    DECLARE_EMPTY_CTOR_DTOR(USBDeviceFilters)
     
    5747    void uninit();
    5848
    59     // IUSBDeviceFilters attributes
    60     STDMETHOD(COMGETTER(DeviceFilters))(ComSafeArrayOut(IUSBDeviceFilter *, aDevicesFilters));
     49    // public methods only for internal purposes
     50    HRESULT i_loadSettings(const settings::USB &data);
     51    HRESULT i_saveSettings(settings::USB &data);
    6152
    62     // IUSBDeviceFilters methods
    63     STDMETHOD(CreateDeviceFilter)(IN_BSTR aName, IUSBDeviceFilter **aFilter);
    64     STDMETHOD(InsertDeviceFilter)(ULONG aPosition, IUSBDeviceFilter *aFilter);
    65     STDMETHOD(RemoveDeviceFilter)(ULONG aPosition, IUSBDeviceFilter **aFilter);
    66 
    67     // public methods only for internal purposes
    68 
    69     HRESULT loadSettings(const settings::USB &data);
    70     HRESULT saveSettings(settings::USB &data);
    71 
    72     void rollback();
    73     void commit();
    74     void copyFrom(USBDeviceFilters *aThat);
     53    void i_rollback();
     54    void i_commit();
     55    void i_copyFrom(USBDeviceFilters *aThat);
    7556
    7657#ifdef VBOX_WITH_USB
    77     HRESULT onDeviceFilterChange(USBDeviceFilter *aFilter,
    78                                  BOOL aActiveChanged = FALSE);
    79 
    80     bool hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
    81     bool hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
    82 
    83     HRESULT notifyProxy(bool aInsertFilters);
     58    HRESULT i_onDeviceFilterChange(USBDeviceFilter *aFilter,
     59                                   BOOL aActiveChanged = FALSE);
     60    bool i_hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs);
     61    bool i_hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs);
     62    HRESULT i_notifyProxy(bool aInsertFilters);
    8463#endif /* VBOX_WITH_USB */
    8564
    8665    // public methods for internal purposes only
    8766    // (ensure there is a caller and a read lock before calling them!)
    88     Machine* getMachine();
     67    Machine* i_getMachine();
    8968
    9069private:
    9170
    92     void printList();
     71    // Wrapped IUSBDeviceFilters attributes
     72    HRESULT getDeviceFilters(std::vector<ComPtr<IUSBDeviceFilter> > &aDeviceFilters);
    9373
     74    // wrapped IUSBDeviceFilters methods
     75    HRESULT createDeviceFilter(const com::Utf8Str &aName,
     76                               ComPtr<IUSBDeviceFilter> &aFilter);
     77    HRESULT insertDeviceFilter(ULONG aPosition,
     78                               const ComPtr<IUSBDeviceFilter> &aFilter);
     79    HRESULT removeDeviceFilter(ULONG aPosition,
     80                               ComPtr<IUSBDeviceFilter> &aFilter);
    9481    struct Data;
    9582    Data *m;
  • trunk/src/VBox/Main/src-server/ApplianceImpl.cpp

    r49760 r49951  
    616616    SystemProperties *pSysProps = mVirtualBox->getSystemProperties();
    617617    {
    618         ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension("iso");
     618        ComObjPtr<MediumFormat> trgFormat = pSysProps->i_mediumFormatFromExtension("iso");
    619619        if (trgFormat.isNull())
    620620            return setError(E_FAIL, tr("Can't find appropriate medium format for ISO type of a virtual disk."));
     
    630630
    631631    {
    632         ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension("vmdk");
     632        ComObjPtr<MediumFormat> trgFormat = pSysProps->i_mediumFormatFromExtension("vmdk");
    633633        if (trgFormat.isNull())
    634634            return setError(E_FAIL, tr("Can't find appropriate medium format for VMDK type of a virtual disk."));
     
    647647
    648648    {
    649         ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension("vhd");
     649        ComObjPtr<MediumFormat> trgFormat = pSysProps->i_mediumFormatFromExtension("vhd");
    650650        if (trgFormat.isNull())
    651651            return setError(E_FAIL, tr("Can't find appropriate medium format for VHD type of a virtual disk."));
     
    747747            if (pszExt)
    748748                pszExt++;
    749             mf = pSysProps->mediumFormatFromExtension(pszExt);
     749            mf = pSysProps->i_mediumFormatFromExtension(pszExt);
    750750        }
    751751    }
    752752    else
    753         mf = pSysProps->mediumFormat(strSrcFormat);
     753        mf = pSysProps->i_mediumFormat(strSrcFormat);
    754754
    755755    if (mf.isNull())
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r49795 r49951  
    20592059            AutoReadLock propsLock(pSysProps COMMA_LOCKVAL_SRC_POS);
    20602060            // We are always exporting to VMDK stream optimized for now
    2061             formatTemp = pSysProps->mediumFormatFromExtension("iso");
    2062 
    2063             format = pSysProps->mediumFormat("VMDK");
     2061            formatTemp = pSysProps->i_mediumFormatFromExtension("iso");
     2062
     2063            format = pSysProps->i_mediumFormat("VMDK");
    20642064            if (format.isNull())
    20652065                throw setError(VBOX_E_NOT_SUPPORTED,
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r49795 r49951  
    23582358                const char *pszSuff = RTPathSuffix(strTargetPath->c_str());
    23592359                /* Figure out which format the user like to have. Default is VMDK. */
    2360                 ComObjPtr<MediumFormat> trgFormat = pSysProps->mediumFormatFromExtension(&pszSuff[1]);
     2360                ComObjPtr<MediumFormat> trgFormat = pSysProps->i_mediumFormatFromExtension(&pszSuff[1]);
    23612361                if (trgFormat.isNull())
    23622362                    throw setError(VBOX_E_NOT_SUPPORTED,
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r49872 r49951  
    14091409    /* notify the proxy (only when the filter is active) */
    14101410    if (    m->pUSBProxyService->isActive()
    1411          && pFilter->getData().mActive)
    1412     {
    1413         ComAssertRet(pFilter->getId() == NULL, E_FAIL);
    1414         pFilter->getId() = m->pUSBProxyService->insertFilter(&pFilter->getData().mUSBFilter);
     1411         && pFilter->i_getData().mActive)
     1412    {
     1413        ComAssertRet(pFilter->i_getId() == NULL, E_FAIL);
     1414        pFilter->i_getId() = m->pUSBProxyService->insertFilter(&pFilter->i_getData().mUSBFilter);
    14151415    }
    14161416
     
    14631463
    14641464    /* notify the proxy (only when the filter is active) */
    1465     if (m->pUSBProxyService->isActive() && filter->getData().mActive)
    1466     {
    1467         ComAssertRet(filter->getId() != NULL, E_FAIL);
    1468         m->pUSBProxyService->removeFilter(filter->getId());
    1469         filter->getId() = NULL;
     1465    if (m->pUSBProxyService->isActive() && filter->i_getData().mActive)
     1466    {
     1467        ComAssertRet(filter->i_getId() != NULL, E_FAIL);
     1468        m->pUSBProxyService->removeFilter(filter->i_getId());
     1469        filter->i_getId() = NULL;
    14701470    }
    14711471
     
    17421742
    17431743        /* notify the proxy (only when the filter is active) */
    1744         if (pFilter->getData().mActive)
     1744        if (pFilter->i_getData().mActive)
    17451745        {
    17461746            HostUSBDeviceFilter *flt = pFilter; /* resolve ambiguity */
    1747             flt->getId() = m->pUSBProxyService->insertFilter(&pFilter->getData().mUSBFilter);
     1747            flt->i_getId() = m->pUSBProxyService->insertFilter(&pFilter->i_getData().mUSBFilter);
    17481748        }
    17491749    }
     
    17711771        ComObjPtr<HostUSBDeviceFilter> pFilter = *it;
    17721772        settings::USBDeviceFilter f;
    1773         pFilter->saveSettings(f);
     1773        pFilter->i_saveSettings(f);
    17741774        data.llUSBDeviceFilters.push_back(f);
    17751775    }
     
    22202220        {
    22212221            // insert/remove the filter from the proxy
    2222             if (aFilter->getData().mActive)
     2222            if (aFilter->i_getData().mActive)
    22232223            {
    2224                 ComAssertRet(aFilter->getId() == NULL, E_FAIL);
    2225                 aFilter->getId() = m->pUSBProxyService->insertFilter(&aFilter->getData().mUSBFilter);
     2224                ComAssertRet(aFilter->i_getId() == NULL, E_FAIL);
     2225                aFilter->i_getId() = m->pUSBProxyService->insertFilter(&aFilter->i_getData().mUSBFilter);
    22262226            }
    22272227            else
    22282228            {
    2229                 ComAssertRet(aFilter->getId() != NULL, E_FAIL);
    2230                 m->pUSBProxyService->removeFilter(aFilter->getId());
    2231                 aFilter->getId() = NULL;
     2229                ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
     2230                m->pUSBProxyService->removeFilter(aFilter->i_getId());
     2231                aFilter->i_getId() = NULL;
    22322232            }
    22332233        }
    22342234        else
    22352235        {
    2236             if (aFilter->getData().mActive)
     2236            if (aFilter->i_getData().mActive)
    22372237            {
    22382238                // update the filter in the proxy
    2239                 ComAssertRet(aFilter->getId() != NULL, E_FAIL);
    2240                 m->pUSBProxyService->removeFilter(aFilter->getId());
    2241                 aFilter->getId() = m->pUSBProxyService->insertFilter(&aFilter->getData().mUSBFilter);
     2239                ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
     2240                m->pUSBProxyService->removeFilter(aFilter->i_getId());
     2241                aFilter->i_getId() = m->pUSBProxyService->insertFilter(&aFilter->i_getData().mUSBFilter);
    22422242            }
    22432243        }
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r49871 r49951  
    344344            /* Apply network adapters defaults */
    345345            for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot)
    346                 mNetworkAdapters[slot]->applyDefaults(aOsType);
     346                mNetworkAdapters[slot]->i_applyDefaults(aOsType);
    347347
    348348            /* Apply serial port defaults */
     
    93769376
    93779377        /* USB device filters */
    9378         rc = mUSBDeviceFilters->loadSettings(data.usbSettings);
     9378        rc = mUSBDeviceFilters->i_loadSettings(data.usbSettings);
    93799379        if (FAILED(rc)) return rc;
    93809380
     
    94019401            /* slot unicity is guaranteed by XML Schema */
    94029402            AssertBreak(nic.ulSlot < mNetworkAdapters.size());
    9403             rc = mNetworkAdapters[nic.ulSlot]->loadSettings(mBandwidthControl, nic);
     9403            rc = mNetworkAdapters[nic.ulSlot]->i_loadSettings(mBandwidthControl, nic);
    94049404            if (FAILED(rc)) return rc;
    94059405        }
     
    1067810678
    1067910679        /* USB device filters (required) */
    10680         rc = mUSBDeviceFilters->saveSettings(data.usbSettings);
     10680        rc = mUSBDeviceFilters->i_saveSettings(data.usbSettings);
    1068110681        if (FAILED(rc)) throw rc;
    1068210682
     
    1069410694            if (mNetworkAdapters[slot])
    1069510695            {
    10696                 rc = mNetworkAdapters[slot]->saveSettings(nic);
     10696                rc = mNetworkAdapters[slot]->i_saveSettings(nic);
    1069710697                if (FAILED(rc)) throw rc;
    1069810698
     
    1212012120
    1212112121    if (mUSBDeviceFilters && (mData->flModifications & IsModified_USB))
    12122         mUSBDeviceFilters->rollback();
     12122        mUSBDeviceFilters->i_rollback();
    1212312123
    1212412124    if (mBandwidthControl && (mData->flModifications & IsModified_BandwidthControl))
     
    1213412134        for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
    1213512135            if (    mNetworkAdapters[slot]
    12136                  && mNetworkAdapters[slot]->isModified())
     12136                 && mNetworkAdapters[slot]->i_isModified())
    1213712137            {
    12138                 mNetworkAdapters[slot]->rollback();
     12138                mNetworkAdapters[slot]->i_rollback();
    1213912139                networkAdapters[slot] = mNetworkAdapters[slot];
    1214012140            }
     
    1222512225    mVRDEServer->i_commit();
    1222612226    mAudioAdapter->i_commit();
    12227     mUSBDeviceFilters->commit();
     12227    mUSBDeviceFilters->i_commit();
    1222812228    mBandwidthControl->i_commit();
    1222912229
     
    1223812238        /* commit everything, even the ones which will go away */
    1223912239        for (size_t slot = 0; slot < mNetworkAdapters.size(); slot++)
    12240             mNetworkAdapters[slot]->commit();
     12240            mNetworkAdapters[slot]->i_commit();
    1224112241        /* copy over the new entries, creating a peer and uninit the original */
    1224212242        mPeer->mNetworkAdapters.resize(RT_MAX(newSize, mPeer->mNetworkAdapters.size()));
     
    1224412244        {
    1224512245            /* look if this adapter has a peer device */
    12246             ComObjPtr<NetworkAdapter> peer = mNetworkAdapters[slot]->getPeer();
     12246            ComObjPtr<NetworkAdapter> peer = mNetworkAdapters[slot]->i_getPeer();
    1224712247            if (!peer)
    1224812248            {
     
    1227612276    {
    1227712277        for (size_t slot = 0; slot < mNetworkAdapters.size(); slot++)
    12278             mNetworkAdapters[slot]->commit();
     12278            mNetworkAdapters[slot]->i_commit();
    1227912279    }
    1228012280
     
    1247412474    mVRDEServer->i_copyFrom(aThat->mVRDEServer);
    1247512475    mAudioAdapter->i_copyFrom(aThat->mAudioAdapter);
    12476     mUSBDeviceFilters->copyFrom(aThat->mUSBDeviceFilters);
     12476    mUSBDeviceFilters->i_copyFrom(aThat->mUSBDeviceFilters);
    1247712477    mBandwidthControl->i_copyFrom(aThat->mBandwidthControl);
    1247812478
     
    1250512505    mNetworkAdapters.resize(aThat->mNetworkAdapters.size());
    1250612506    for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++)
    12507         mNetworkAdapters[slot]->copyFrom(aThat->mNetworkAdapters[slot]);
     12507        mNetworkAdapters[slot]->i_copyFrom(aThat->mNetworkAdapters[slot]);
    1250812508    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
    1250912509        mSerialPorts[slot]->i_copyFrom(aThat->mSerialPorts[slot]);
     
    1297412974         * This is identical to SessionMachine::DetachAllUSBDevices except
    1297512975         * for the aAbnormal argument. */
    12976         HRESULT rc = mUSBDeviceFilters->notifyProxy(false /* aInsertFilters */);
     12976        HRESULT rc = mUSBDeviceFilters->i_notifyProxy(false /* aInsertFilters */);
    1297712977        AssertComRC(rc);
    1297812978        NOREF(rc);
     
    1342213422
    1342313423#ifdef VBOX_WITH_USB
    13424     *aMatched = mUSBDeviceFilters->hasMatchingFilter(aUSBDevice, aMaskedIfs);
     13424    *aMatched = mUSBDeviceFilters->i_hasMatchingFilter(aUSBDevice, aMaskedIfs);
    1342513425#else
    1342613426    NOREF(aUSBDevice);
     
    1349413494
    1349513495#ifdef VBOX_WITH_USB
    13496     HRESULT rc = mUSBDeviceFilters->notifyProxy(true /* aInsertFilters */);
     13496    HRESULT rc = mUSBDeviceFilters->i_notifyProxy(true /* aInsertFilters */);
    1349713497    AssertComRC(rc);
    1349813498    NOREF(rc);
     
    1352413524
    1352513525#ifdef VBOX_WITH_USB
    13526     HRESULT rc = mUSBDeviceFilters->notifyProxy(false /* aInsertFilters */);
     13526    HRESULT rc = mUSBDeviceFilters->i_notifyProxy(false /* aInsertFilters */);
    1352713527    AssertComRC(rc);
    1352813528    NOREF(rc);
     
    1451014510         *        elsewhere... */
    1451114511            alock.release();
    14512             return mUSBDeviceFilters->hasMatchingFilter(aDevice, aMaskedIfs);
     14512            return mUSBDeviceFilters->i_hasMatchingFilter(aDevice, aMaskedIfs);
    1451314513        default: break;
    1451414514    }
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r49871 r49951  
    61606160        AutoReadLock propsLock(pSysProps COMMA_LOCKVAL_SRC_POS);
    61616161
    6162         unconst(m->formatObj) = pSysProps->mediumFormat(aFormat);
     6162        unconst(m->formatObj) = pSysProps->i_mediumFormat(aFormat);
    61636163        if (m->formatObj.isNull())
    61646164            return setError(E_INVALIDARG,
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r49871 r49951  
    4848HRESULT NetworkAdapter::FinalConstruct()
    4949{
    50 
    5150    return BaseFinalConstruct();
    5251}
     
    9695     * changing some other property (i.e. after mData.backup()) and after the
    9796     * subsequent mData.rollback(). */
    98     generateMACAddress();
     97    i_generateMACAddress();
    9998
    10099    /* Confirm a successful initialization */
     
    213212}
    214213
    215 // INetworkAdapter properties
     214// wrapped INetworkAdapter properties
    216215////////////////////////////////////////////////////////////////////////////////
    217 
    218 STDMETHODIMP NetworkAdapter::COMGETTER(AdapterType)(NetworkAdapterType_T *aAdapterType)
    219 {
    220     CheckComArgOutPointerValid(aAdapterType);
    221 
    222     AutoCaller autoCaller(this);
    223     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    224 
     216HRESULT NetworkAdapter::getAdapterType(NetworkAdapterType_T *aAdapterType)
     217{
    225218    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    226219
     
    230223}
    231224
    232 STDMETHODIMP NetworkAdapter::COMSETTER(AdapterType)(NetworkAdapterType_T aAdapterType)
    233 {
    234     AutoCaller autoCaller(this);
    235     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    236 
     225HRESULT NetworkAdapter::setAdapterType(NetworkAdapterType_T aAdapterType)
     226{
    237227    /* the machine needs to be mutable */
    238228    AutoMutableStateDependency adep(mParent);
     
    282272}
    283273
    284 STDMETHODIMP NetworkAdapter::COMGETTER(Slot)(ULONG *aSlot)
    285 {
    286     CheckComArgOutPointerValid(aSlot);
    287 
    288     AutoCaller autoCaller(this);
    289     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    290 
     274
     275HRESULT NetworkAdapter::getSlot(ULONG *aSlot)
     276{
    291277    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    292278
     
    296282}
    297283
    298 STDMETHODIMP NetworkAdapter::COMGETTER(Enabled)(BOOL *aEnabled)
    299 {
    300     CheckComArgOutPointerValid(aEnabled);
    301 
    302     AutoCaller autoCaller(this);
    303     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    304 
     284HRESULT NetworkAdapter::getEnabled(BOOL *aEnabled)
     285{
    305286    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    306287
     
    310291}
    311292
    312 STDMETHODIMP NetworkAdapter::COMSETTER(Enabled)(BOOL aEnabled)
    313 {
    314     AutoCaller autoCaller(this);
    315     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    316 
     293HRESULT NetworkAdapter::setEnabled(BOOL aEnabled)
     294{
    317295    /* the machine needs to be mutable */
    318296    AutoMutableStateDependency adep(mParent);
     
    342320}
    343321
    344 STDMETHODIMP NetworkAdapter::COMGETTER(MACAddress)(BSTR *aMACAddress)
    345 {
    346     CheckComArgOutPointerValid(aMACAddress);
    347 
    348     AutoCaller autoCaller(this);
    349     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    350 
     322HRESULT NetworkAdapter::getMACAddress(com::Utf8Str &aMACAddress)
     323{
    351324    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    352325
    353326    ComAssertRet(!mData->mMACAddress.isEmpty(), E_FAIL);
    354327
    355     mData->mMACAddress.cloneTo(aMACAddress);
    356 
    357     return S_OK;
    358 }
    359 
    360 HRESULT NetworkAdapter::updateMacAddress(Utf8Str aMACAddress)
     328    aMACAddress = mData->mMACAddress;
     329
     330    return S_OK;
     331}
     332
     333HRESULT NetworkAdapter::i_updateMacAddress(Utf8Str aMACAddress)
    361334{
    362335    HRESULT rc = S_OK;
     
    366339     */
    367340    if (aMACAddress.isEmpty())
    368         generateMACAddress();
     341        i_generateMACAddress();
    369342    else
    370343    {
     
    409382}
    410383
    411 STDMETHODIMP NetworkAdapter::COMSETTER(MACAddress)(IN_BSTR aMACAddress)
    412 {
    413     AutoCaller autoCaller(this);
    414     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    415 
     384HRESULT NetworkAdapter::setMACAddress(const com::Utf8Str &aMACAddress)
     385{
    416386    /* the machine needs to be mutable */
    417387    AutoMutableStateDependency adep(mParent);
    418388    if (FAILED(adep.rc())) return adep.rc();
    419389
    420 
    421390    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    422391    mData.backup();
    423392
    424     HRESULT rc = updateMacAddress(aMACAddress);
     393    HRESULT rc = i_updateMacAddress(aMACAddress);
    425394    if (SUCCEEDED(rc))
    426395    {
     
    428397        // leave the lock before informing callbacks
    429398        alock.release();
     399
    430400
    431401        AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);       // mParent is const, no need to lock
     
    441411}
    442412
    443 STDMETHODIMP NetworkAdapter::COMGETTER(AttachmentType)(NetworkAttachmentType_T *aAttachmentType)
    444 {
    445     CheckComArgOutPointerValid(aAttachmentType);
    446 
    447     AutoCaller autoCaller(this);
    448     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    449 
     413HRESULT NetworkAdapter::getAttachmentType(NetworkAttachmentType_T *aAttachmentType)
     414{
    450415    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    451416
     
    455420}
    456421
    457 STDMETHODIMP NetworkAdapter::COMSETTER(AttachmentType)(NetworkAttachmentType_T aAttachmentType)
    458 {
    459     AutoCaller autoCaller(this);
    460     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    461 
     422HRESULT NetworkAdapter::setAttachmentType(NetworkAttachmentType_T aAttachmentType)
     423{
    462424    /* the machine needs to be mutable */
    463425    AutoMutableStateDependency adep(mParent);
     
    496458
    497459        if (oldAttachmentType == NetworkAttachmentType_NATNetwork)
    498             checkAndSwitchFromNatNetworking(mData->mNATNetwork.raw());
     460            i_checkAndSwitchFromNatNetworking(mData->mNATNetwork);
    499461
    500462        if (aAttachmentType == NetworkAttachmentType_NATNetwork)
    501             switchToNatNetworking(mData->mNATNetwork.raw());
     463            i_switchToNatNetworking(mData->mNATNetwork);
    502464
    503465        /* Adapt the CFGM logic and notify the guest => changeAdapter=TRUE. */
     
    508470}
    509471
    510 STDMETHODIMP NetworkAdapter::COMGETTER(BridgedInterface)(BSTR *aBridgedInterface)
    511 {
    512     CheckComArgOutPointerValid(aBridgedInterface);
    513 
    514     AutoCaller autoCaller(this);
    515     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    516 
    517     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    518 
    519     mData->mBridgedInterface.cloneTo(aBridgedInterface);
    520 
    521     return S_OK;
    522 }
    523 
    524 STDMETHODIMP NetworkAdapter::COMSETTER(BridgedInterface)(IN_BSTR aBridgedInterface)
    525 {
    526     Bstr bstrEmpty("");
    527     if (!aBridgedInterface)
    528         aBridgedInterface = bstrEmpty.raw();
    529 
    530     AutoCaller autoCaller(this);
    531     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    532 
     472HRESULT NetworkAdapter::getBridgedInterface(com::Utf8Str &aBridgedInterface)
     473{
     474    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     475
     476    aBridgedInterface = mData->mBridgedInterface;
     477
     478    return S_OK;
     479}
     480
     481HRESULT NetworkAdapter::setBridgedInterface(const com::Utf8Str &aBridgedInterface)
     482{
    533483    /* the machine needs to be mutable */
    534484    AutoMutableStateDependency adep(mParent);
     
    541491        /* if an empty/null string is to be set, bridged interface must be
    542492         * turned off */
    543         if (   (aBridgedInterface == NULL || *aBridgedInterface == '\0')
     493        if (aBridgedInterface.isEmpty()
    544494            && mData->mAttachmentType == NetworkAttachmentType_Bridged)
    545495        {
     
    568518}
    569519
    570 STDMETHODIMP NetworkAdapter::COMGETTER(HostOnlyInterface)(BSTR *aHostOnlyInterface)
    571 {
    572     CheckComArgOutPointerValid(aHostOnlyInterface);
    573 
    574     AutoCaller autoCaller(this);
    575     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    576 
    577     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    578 
    579     mData->mHostOnlyInterface.cloneTo(aHostOnlyInterface);
    580 
    581     return S_OK;
    582 }
    583 
    584 STDMETHODIMP NetworkAdapter::COMSETTER(HostOnlyInterface)(IN_BSTR aHostOnlyInterface)
    585 {
    586     Bstr bstrEmpty("");
    587     if (!aHostOnlyInterface)
    588         aHostOnlyInterface = bstrEmpty.raw();
    589 
    590     AutoCaller autoCaller(this);
    591     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    592 
     520HRESULT NetworkAdapter::getHostOnlyInterface(com::Utf8Str &aHostOnlyInterface)
     521{
     522    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     523
     524    aHostOnlyInterface = mData->mHostOnlyInterface;
     525
     526    return S_OK;
     527}
     528
     529HRESULT NetworkAdapter::setHostOnlyInterface(const com::Utf8Str &aHostOnlyInterface)
     530{
    593531    /* the machine needs to be mutable */
    594532    AutoMutableStateDependency adep(mParent);
     
    601539        /* if an empty/null string is to be set, host only interface must be
    602540         * turned off */
    603         if (   (aHostOnlyInterface == NULL || *aHostOnlyInterface == '\0')
    604             && mData->mAttachmentType == NetworkAttachmentType_HostOnly)
     541        if ( aHostOnlyInterface.isEmpty()
     542             && mData->mAttachmentType == NetworkAttachmentType_HostOnly)
    605543        {
    606544            return setError(E_FAIL,
     
    612550
    613551        m_fModified = true;
     552
    614553        // leave the lock before informing callbacks
    615554        alock.release();
     
    628567}
    629568
    630 STDMETHODIMP NetworkAdapter::COMGETTER(InternalNetwork)(BSTR *aInternalNetwork)
    631 {
    632     CheckComArgOutPointerValid(aInternalNetwork);
    633 
    634     AutoCaller autoCaller(this);
    635     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    636 
    637     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    638 
    639     mData->mInternalNetwork.cloneTo(aInternalNetwork);
    640 
    641     return S_OK;
    642 }
    643 
    644 STDMETHODIMP NetworkAdapter::COMSETTER(InternalNetwork)(IN_BSTR aInternalNetwork)
    645 {
    646     AutoCaller autoCaller(this);
    647     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    648 
     569
     570HRESULT NetworkAdapter::getInternalNetwork(com::Utf8Str &aInternalNetwork)
     571{
     572    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     573
     574    aInternalNetwork = mData->mInternalNetwork;
     575
     576    return S_OK;
     577}
     578
     579HRESULT NetworkAdapter::setInternalNetwork(const com::Utf8Str &aInternalNetwork)
     580{
    649581    /* the machine needs to be mutable */
    650582    AutoMutableStateDependency adep(mParent);
     
    657589        /* if an empty/null string is to be set, internal networking must be
    658590         * turned off */
    659         if (   (aInternalNetwork == NULL || *aInternalNetwork == '\0')
    660             && mData->mAttachmentType == NetworkAttachmentType_Internal)
     591        if (aInternalNetwork.isEmpty() && mData->mAttachmentType == NetworkAttachmentType_Internal)
    661592        {
    662593            return setError(E_FAIL,
    663594                            tr("Empty or null internal network name is not valid"));
    664595        }
    665 
    666596        mData.backup();
    667597        mData->mInternalNetwork = aInternalNetwork;
     
    684614}
    685615
    686 STDMETHODIMP NetworkAdapter::COMGETTER(NATNetwork)(BSTR *aNATNetwork)
    687 {
    688     CheckComArgOutPointerValid(aNATNetwork);
    689 
    690     AutoCaller autoCaller(this);
    691     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    692 
    693     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    694 
    695     mData->mNATNetwork.cloneTo(aNATNetwork);
    696 
    697     return S_OK;
    698 }
    699 
    700 STDMETHODIMP NetworkAdapter::COMSETTER(NATNetwork)(IN_BSTR aNATNetwork)
    701 {
    702     Bstr bstrEmpty("");
    703     if (!aNATNetwork)
    704         aNATNetwork = bstrEmpty.raw();
    705 
    706     AutoCaller autoCaller(this);
    707     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     616HRESULT NetworkAdapter::getNATNetwork(com::Utf8Str &aNATNetwork)
     617{
     618    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     619
     620    aNATNetwork = mData->mNATNetwork;
     621
     622    return S_OK;
     623}
     624
     625
     626HRESULT NetworkAdapter::setNATNetwork(const com::Utf8Str &aNATNetwork)
     627{
     628
    708629
    709630    /* the machine needs to be mutable */
     
    715636    if (mData->mNATNetwork != aNATNetwork)
    716637    {
    717 
    718638        /* if an empty/null string is to be set, host only interface must be
    719639         * turned off */
    720         if (   (aNATNetwork == NULL || *aNATNetwork == '\0')
     640        if (aNATNetwork.isEmpty()
    721641            && mData->mAttachmentType == NetworkAttachmentType_NATNetwork)
    722         {
    723642            return setError(E_FAIL,
    724643                            tr("Empty or null NAT network name is not valid"));
    725         }
    726644
    727645        mData.backup();
     
    737655        mParent->setModified(Machine::IsModified_NetworkAdapters);
    738656        mlock.release();
    739 
    740         checkAndSwitchFromNatNetworking(oldNatNetworkName.raw());
    741 
    742         switchToNatNetworking(aNATNetwork);
    743 
     657        i_checkAndSwitchFromNatNetworking(oldNatNetworkName.raw());
     658
     659        i_switchToNatNetworking(aNATNetwork);
    744660        /* When changing the host adapter, adapt the CFGM logic to make this
    745661         * change immediately effect and to notify the guest that the network
     
    751667}
    752668
    753 STDMETHODIMP NetworkAdapter::COMGETTER(GenericDriver)(BSTR *aGenericDriver)
    754 {
    755     CheckComArgOutPointerValid(aGenericDriver);
    756 
    757     AutoCaller autoCaller(this);
    758     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    759 
    760     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    761 
    762     mData->mGenericDriver.cloneTo(aGenericDriver);
    763 
    764     return S_OK;
    765 }
    766 
    767 STDMETHODIMP NetworkAdapter::COMSETTER(GenericDriver)(IN_BSTR aGenericDriver)
    768 {
    769     Bstr bstrEmpty("");
    770     if (!aGenericDriver)
    771         aGenericDriver = bstrEmpty.raw();
    772 
    773     AutoCaller autoCaller(this);
    774     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    775 
     669HRESULT NetworkAdapter::getGenericDriver(com::Utf8Str &aGenericDriver)
     670{
     671    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     672
     673    aGenericDriver = mData->mGenericDriver;
     674
     675    return S_OK;
     676}
     677
     678HRESULT NetworkAdapter::setGenericDriver(const com::Utf8Str &aGenericDriver)
     679{
    776680    /* the machine needs to be mutable */
    777681    AutoMutableStateDependency adep(mParent);
     
    794698}
    795699
    796 STDMETHODIMP NetworkAdapter::COMGETTER(CableConnected)(BOOL *aConnected)
    797 {
    798     CheckComArgOutPointerValid(aConnected);
    799 
    800     AutoCaller autoCaller(this);
    801     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    802 
     700
     701HRESULT NetworkAdapter::getCableConnected(BOOL *aConnected)
     702{
    803703    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    804704
     
    808708}
    809709
    810 STDMETHODIMP NetworkAdapter::COMSETTER(CableConnected)(BOOL aConnected)
    811 {
    812     AutoCaller autoCaller(this);
    813     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    814 
     710
     711HRESULT NetworkAdapter::setCableConnected(BOOL aConnected)
     712{
    815713    /* the machine needs to be mutable */
    816714    AutoMutableStateDependency adep(mParent);
     
    839737}
    840738
    841 STDMETHODIMP NetworkAdapter::COMGETTER(LineSpeed)(ULONG *aSpeed)
    842 {
    843     CheckComArgOutPointerValid(aSpeed);
    844 
    845     AutoCaller autoCaller(this);
    846     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    847 
     739
     740HRESULT NetworkAdapter::getLineSpeed(ULONG *aSpeed)
     741{
    848742    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    849743
     
    853747}
    854748
    855 STDMETHODIMP NetworkAdapter::COMSETTER(LineSpeed)(ULONG aSpeed)
    856 {
    857     AutoCaller autoCaller(this);
    858     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    859 
     749HRESULT NetworkAdapter::setLineSpeed(ULONG aSpeed)
     750{
    860751    /* the machine needs to be mutable */
    861752    AutoMutableStateDependency adep(mParent);
     
    884775}
    885776
    886 
    887 STDMETHODIMP NetworkAdapter::COMGETTER(PromiscModePolicy)(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy)
    888 {
    889     CheckComArgOutPointerValid(aPromiscModePolicy);
    890 
    891     AutoCaller autoCaller(this);
    892     HRESULT hrc = autoCaller.rc();
    893     if (SUCCEEDED(hrc))
    894     {
    895         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    896         *aPromiscModePolicy = mData->mPromiscModePolicy;
    897     }
    898     return hrc;
    899 }
    900 
    901 STDMETHODIMP NetworkAdapter::COMSETTER(PromiscModePolicy)(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy)
     777HRESULT NetworkAdapter::getPromiscModePolicy(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy)
     778{
     779    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     780
     781    *aPromiscModePolicy = mData->mPromiscModePolicy;
     782
     783    return S_OK;
     784}
     785
     786HRESULT NetworkAdapter::setPromiscModePolicy(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy)
    902787{
    903788    switch (aPromiscModePolicy)
     
    932817}
    933818
    934 STDMETHODIMP NetworkAdapter::COMGETTER(TraceEnabled)(BOOL *aEnabled)
    935 {
    936     CheckComArgOutPointerValid(aEnabled);
    937 
    938     AutoCaller autoCaller(this);
    939     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     819
     820HRESULT NetworkAdapter::getTraceEnabled(BOOL *aEnabled)
     821{
    940822
    941823    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    942824
    943825    *aEnabled = mData->mTraceEnabled;
    944     return S_OK;
    945 }
    946 
    947 STDMETHODIMP NetworkAdapter::COMSETTER(TraceEnabled)(BOOL aEnabled)
    948 {
    949     AutoCaller autoCaller(this);
    950     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    951 
     826
     827    return S_OK;
     828}
     829
     830HRESULT NetworkAdapter::setTraceEnabled(BOOL aEnabled)
     831{
    952832    /* the machine needs to be mutable */
    953833    AutoMutableStateDependency adep(mParent);
     
    976856}
    977857
    978 STDMETHODIMP NetworkAdapter::COMGETTER(TraceFile)(BSTR *aTraceFile)
    979 {
    980     CheckComArgOutPointerValid(aTraceFile);
    981 
    982     AutoCaller autoCaller(this);
    983     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    984 
    985     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    986 
    987     mData->mTraceFile.cloneTo(aTraceFile);
    988 
    989     return S_OK;
    990 }
    991 
    992 STDMETHODIMP NetworkAdapter::COMSETTER(TraceFile)(IN_BSTR aTraceFile)
    993 {
    994     AutoCaller autoCaller(this);
    995     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    996 
     858HRESULT NetworkAdapter::getTraceFile(com::Utf8Str &aTraceFile)
     859{
     860    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     861
     862    aTraceFile = mData->mTraceFile;
     863
     864    return S_OK;
     865}
     866
     867
     868HRESULT NetworkAdapter::setTraceFile(const com::Utf8Str &aTraceFile)
     869{
    997870    /* the machine needs to be mutable */
    998871    AutoMutableStateDependency adep(mParent);
     
    1021894}
    1022895
    1023 STDMETHODIMP NetworkAdapter::COMGETTER(NATEngine)(INATEngine **aNATEngine)
    1024 {
    1025     CheckComArgOutPointerValid(aNATEngine);
    1026 
    1027     AutoCaller autoCaller(this);
    1028     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1029 
    1030     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1031 
    1032     mNATEngine.queryInterfaceTo(aNATEngine);
    1033 
    1034     return S_OK;
    1035 }
    1036 
    1037 STDMETHODIMP NetworkAdapter::COMGETTER(BootPriority)(ULONG *aBootPriority)
    1038 {
    1039     CheckComArgOutPointerValid(aBootPriority);
    1040 
    1041     AutoCaller autoCaller(this);
    1042     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1043 
     896HRESULT NetworkAdapter::getNATEngine(ComPtr<INATEngine> &aNATEngine)
     897{
     898    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     899
     900    aNATEngine  = mNATEngine;
     901
     902    return S_OK;
     903}
     904
     905HRESULT NetworkAdapter::getBootPriority(ULONG *aBootPriority)
     906{
    1044907    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1045908
     
    1049912}
    1050913
    1051 STDMETHODIMP NetworkAdapter::COMSETTER(BootPriority)(ULONG aBootPriority)
    1052 {
    1053     AutoCaller autoCaller(this);
    1054     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1055 
     914HRESULT NetworkAdapter::setBootPriority(ULONG aBootPriority)
     915{
    1056916    /* the machine needs to be mutable */
    1057917    AutoMutableStateDependency adep(mParent);
     
    1080940}
    1081941
    1082 // INetworkAdapter methods
     942// wrapped INetworkAdapter methods
    1083943////////////////////////////////////////////////////////////////////////////////
    1084944
    1085 STDMETHODIMP NetworkAdapter::GetProperty(IN_BSTR aKey, BSTR *aValue)
    1086 {
    1087     CheckComArgOutPointerValid(aValue);
    1088 
    1089     AutoCaller autoCaller(this);
    1090     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1091 
    1092     Bstr key = aKey;
    1093     Bstr value;
    1094 
    1095     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1096 
    1097     Utf8Str strKey(key);
    1098     settings::StringsMap::const_iterator it = mData->mGenericProperties.find(strKey);
     945HRESULT NetworkAdapter::getProperty(const com::Utf8Str &aKey, com::Utf8Str &aValue)
     946{
     947    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     948    aValue = "";
     949    settings::StringsMap::const_iterator it = mData->mGenericProperties.find(aKey);
    1099950    if (it != mData->mGenericProperties.end())
    1100     {
    1101         value = it->second; // source is a Utf8Str
    1102         value.cloneTo(aValue);
    1103     }
    1104 
    1105     return S_OK;
    1106 }
    1107 
    1108 STDMETHODIMP NetworkAdapter::SetProperty(IN_BSTR aKey, IN_BSTR aValue)
     951        aValue = it->second; // source is a Utf8Str
     952
     953    return S_OK;
     954}
     955
     956HRESULT NetworkAdapter::setProperty(const com::Utf8Str &aKey, const com::Utf8Str &aValue)
    1109957{
    1110958    LogFlowThisFunc(("\n"));
    1111 
    1112     AutoCaller autoCaller(this);
    1113     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1114 
    1115959    /* The machine needs to be mutable. */
    1116960    AutoMutableStateDependency adep(mParent);
    1117961    if (FAILED(adep.rc())) return adep.rc();
    1118 
    1119     Bstr key = aKey;
    1120 
    1121     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1122 
     962    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1123963    bool fGenericChange = (mData->mAttachmentType == NetworkAttachmentType_Generic);
    1124 
    1125964    /* Generic properties processing.
    1126965     * Look up the old value first; if nothing's changed then do nothing.
    1127966     */
    1128     Utf8Str strValue(aValue);
    1129     Utf8Str strKey(aKey);
    1130967    Utf8Str strOldValue;
    1131 
    1132     settings::StringsMap::const_iterator it = mData->mGenericProperties.find(strKey);
     968    settings::StringsMap::const_iterator it = mData->mGenericProperties.find(aKey);
    1133969    if (it != mData->mGenericProperties.end())
    1134970        strOldValue = it->second;
    1135971
    1136     if (strOldValue != strValue)
    1137     {
    1138         if (strValue.isEmpty())
    1139             mData->mGenericProperties.erase(strKey);
     972    if (strOldValue != aValue)
     973    {
     974        if (aValue.isEmpty())
     975            mData->mGenericProperties.erase(aKey);
    1140976        else
    1141             mData->mGenericProperties[strKey] = strValue;
     977            mData->mGenericProperties[aKey] = aValue;
    1142978
    1143979        /* leave the lock before informing callbacks */
     
    1158994}
    1159995
    1160 STDMETHODIMP NetworkAdapter::GetProperties(IN_BSTR aNames,
    1161                                            ComSafeArrayOut(BSTR, aReturnNames),
    1162                                            ComSafeArrayOut(BSTR, aReturnValues))
    1163 {
    1164     CheckComArgOutSafeArrayPointerValid(aReturnNames);
    1165     CheckComArgOutSafeArrayPointerValid(aReturnValues);
    1166 
    1167     AutoCaller autoCaller(this);
    1168     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1169 
     996HRESULT NetworkAdapter::getProperties(const com::Utf8Str &aNames,
     997                                      std::vector<com::Utf8Str>  &aReturnNames,
     998                                      std::vector<com::Utf8Str>  &aReturnValues)
     999{
    11701000    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    11711001
    11721002    /// @todo make use of aNames according to the documentation
    11731003    NOREF(aNames);
    1174 
    1175     com::SafeArray<BSTR> names(mData->mGenericProperties.size());
    1176     com::SafeArray<BSTR> values(mData->mGenericProperties.size());
     1004    aReturnNames.resize(mData->mGenericProperties.size());
     1005    aReturnValues.resize(mData->mGenericProperties.size());
     1006
    11771007    size_t i = 0;
    11781008
    11791009    for (settings::StringsMap::const_iterator it = mData->mGenericProperties.begin();
    11801010         it != mData->mGenericProperties.end();
    1181          ++it)
    1182     {
    1183         it->first.cloneTo(&names[i]);
    1184         it->second.cloneTo(&values[i]);
    1185         ++i;
    1186     }
    1187 
    1188     names.detachTo(ComSafeArrayOutArg(aReturnNames));
    1189     values.detachTo(ComSafeArrayOutArg(aReturnValues));
     1011         ++it, ++i)
     1012    {
     1013        aReturnNames[i] = it->first;
     1014        aReturnValues[i] = it->second;
     1015    }
    11901016
    11911017    return S_OK;
     
    12051031 *  @note Locks this object for writing.
    12061032 */
    1207 HRESULT NetworkAdapter::loadSettings(BandwidthControl *bwctl,
    1208                                      const settings::NetworkAdapter &data)
     1033HRESULT NetworkAdapter::i_loadSettings(BandwidthControl *bwctl,
     1034                                       const settings::NetworkAdapter &data)
    12091035{
    12101036    AutoCaller autoCaller(this);
     
    12291055    mData->mEnabled = data.fEnabled;
    12301056    /* MAC address (can be null) */
    1231     rc = updateMacAddress(data.strMACAddress);
     1057    rc = i_updateMacAddress(data.strMACAddress);
    12321058    if (FAILED(rc)) return rc;
    12331059    /* cable (required) */
     
    12801106 *  @note Locks this object for reading.
    12811107 */
    1282 HRESULT NetworkAdapter::saveSettings(settings::NetworkAdapter &data)
     1108HRESULT NetworkAdapter::i_saveSettings(settings::NetworkAdapter &data)
    12831109{
    12841110    AutoCaller autoCaller(this);
     
    13301156 * @return
    13311157 */
    1332 bool NetworkAdapter::isModified() {
    1333     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     1158bool NetworkAdapter::i_isModified() {
     1159
     1160    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     1161
    13341162    bool fChanged = m_fModified;
    13351163    fChanged |= (mData->mAdapterType == NetworkAttachmentType_NAT? mNATEngine->i_isModified() : false);
     
    13401168 *  @note Locks this object for writing.
    13411169 */
    1342 void NetworkAdapter::rollback()
     1170void NetworkAdapter::i_rollback()
    13431171{
    13441172    /* sanity */
     
    13551183 *  for writing) if there is one.
    13561184 */
    1357 void NetworkAdapter::commit()
     1185void NetworkAdapter::i_commit()
    13581186{
    13591187    /* sanity */
     
    13841212 *  represented by @a aThat (locked for reading).
    13851213 */
    1386 void NetworkAdapter::copyFrom(NetworkAdapter *aThat)
     1214void NetworkAdapter::i_copyFrom(NetworkAdapter *aThat)
    13871215{
    13881216    AssertReturnVoid(aThat != NULL);
     
    14051233}
    14061234
    1407 void NetworkAdapter::applyDefaults(GuestOSType *aOsType)
     1235void NetworkAdapter::i_applyDefaults(GuestOSType *aOsType)
    14081236{
    14091237    AssertReturnVoid(aOsType != NULL);
     
    14401268}
    14411269
    1442 ComObjPtr<NetworkAdapter> NetworkAdapter::getPeer()
     1270ComObjPtr<NetworkAdapter> NetworkAdapter::i_getPeer()
    14431271{
    14441272    return mPeer;
     
    14561284 *  span.
    14571285 */
    1458 void NetworkAdapter::generateMACAddress()
     1286void NetworkAdapter::i_generateMACAddress()
    14591287{
    14601288    Utf8Str mac;
     
    14641292}
    14651293
    1466 STDMETHODIMP NetworkAdapter::COMGETTER(BandwidthGroup)(IBandwidthGroup **aBwGroup)
     1294HRESULT NetworkAdapter::getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup)
    14671295{
    14681296    LogFlowThisFuncEnter();
    1469     CheckComArgOutPointerValid(aBwGroup);
    14701297
    14711298    HRESULT hrc = S_OK;
    1472 
    1473     AutoCaller autoCaller(this);
    1474     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    14751299
    14761300    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    14821306
    14831307        Assert(SUCCEEDED(hrc)); /* This is not allowed to fail because the existence of the group was checked when it was attached. */
    1484 
    14851308        if (SUCCEEDED(hrc))
    1486             pBwGroup.queryInterfaceTo(aBwGroup);
     1309            pBwGroup.queryInterfaceTo(aBandwidthGroup.asOutParam());
    14871310    }
    14881311
     
    14911314}
    14921315
    1493 STDMETHODIMP NetworkAdapter::COMSETTER(BandwidthGroup)(IBandwidthGroup *aBwGroup)
     1316HRESULT NetworkAdapter::setBandwidthGroup(const ComPtr<IBandwidthGroup> &aBandwidthGroup)
    14941317{
    14951318    LogFlowThisFuncEnter();
    14961319
    1497     AutoCaller autoCaller(this);
    1498     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1499 
    15001320    /* the machine needs to be mutable */
    15011321    AutoMutableStateDependency adep(mParent);
     
    15041324    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    15051325
     1326    IBandwidthGroup *iBw = aBandwidthGroup;
    15061327    Utf8Str strBwGroup;
    1507     if (aBwGroup)
    1508         strBwGroup = static_cast<BandwidthGroup*>(aBwGroup)->i_getName();
     1328    if (aBandwidthGroup)
     1329        strBwGroup = static_cast<BandwidthGroup *>(iBw)->i_getName();
     1330
    15091331    if (mData->mBandwidthGroup != strBwGroup)
    15101332    {
     
    15171339        }
    15181340
    1519         updateBandwidthGroup(pBwGroup);
     1341        i_updateBandwidthGroup(pBwGroup);
    15201342
    15211343        m_fModified = true;
     
    15351357}
    15361358
    1537 void NetworkAdapter::updateBandwidthGroup(BandwidthGroup *aBwGroup)
     1359void NetworkAdapter::i_updateBandwidthGroup(BandwidthGroup *aBwGroup)
    15381360{
    15391361    LogFlowThisFuncEnter();
     
    15651387
    15661388
    1567 HRESULT NetworkAdapter::checkAndSwitchFromNatNetworking(IN_BSTR networkName)
    1568 {
     1389HRESULT NetworkAdapter::i_checkAndSwitchFromNatNetworking(com::Utf8Str networkName)
     1390{
     1391    HRESULT hrc;
    15691392    MachineState_T state;
    15701393
    1571     HRESULT hrc = mParent->COMGETTER(State)(&state);
     1394    hrc = mParent->COMGETTER(State)(&state);
    15721395    if (FAILED(hrc))
    15731396        return hrc;
    15741397
    1575     if (state == MachineState_Running)
     1398    if (   mData->mAttachmentType == NetworkAttachmentType_NATNetwork
     1399        && state == MachineState_Running)
    15761400    {
    15771401        Bstr bstrName;
    15781402        hrc = mParent->COMGETTER(Name)(bstrName.asOutParam());
    1579         LogRel(("VM '%ls' stops using NAT network '%ls'\n", bstrName.raw(), networkName));
    1580         int natCount = mParent->getVirtualBox()->natNetworkRefDec(networkName);
     1403        LogRel(("VM '%ls' stops using NAT network '%ls'\n", bstrName.raw(), Bstr(networkName).raw()));
     1404        int natCount = mParent->getVirtualBox()->natNetworkRefDec(Bstr(networkName).raw());
    15811405        if (natCount == -1)
    15821406            return E_INVALIDARG; /* no such network */
     
    15871411
    15881412
    1589 HRESULT NetworkAdapter::switchToNatNetworking(IN_BSTR aNatNetworkName)
    1590 {
     1413HRESULT NetworkAdapter::i_switchToNatNetworking(const com::Utf8Str &aNatNetworkName)
     1414{
     1415    HRESULT hrc;
    15911416    MachineState_T state;
    15921417
    1593     HRESULT hrc = mParent->COMGETTER(State)(&state);
     1418    hrc = mParent->COMGETTER(State)(&state);
    15941419    if (FAILED(hrc))
    15951420        return hrc;
     
    15991424        Bstr bstrName;
    16001425        hrc = mParent->COMGETTER(Name)(bstrName.asOutParam());
    1601         LogRel(("VM '%ls' starts using NAT network '%ls'\n", bstrName.raw(), aNatNetworkName));
    1602         int natCount = mParent->getVirtualBox()->natNetworkRefInc(aNatNetworkName);
     1426        LogRel(("VM '%ls' starts using NAT network '%ls'\n", bstrName.raw(), Bstr(aNatNetworkName).raw()));
     1427        int natCount = mParent->getVirtualBox()->natNetworkRefInc(Bstr(aNatNetworkName).raw());
    16031428        if (natCount == -1)
    16041429            return E_INVALIDARG; /* not found */
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r48985 r49951  
    9090    unconst(mParent) = aParent;
    9191
    92     setDefaultMachineFolder(Utf8Str::Empty);
    93     setLoggingLevel(Utf8Str::Empty);
    94     setDefaultHardDiskFormat(Utf8Str::Empty);
    95 
    96     setVRDEAuthLibrary(Utf8Str::Empty);
    97     setDefaultVRDEExtPack(Utf8Str::Empty);
     92    i_setDefaultMachineFolder(Utf8Str::Empty);
     93    i_setLoggingLevel(Utf8Str::Empty);
     94    i_setDefaultHardDiskFormat(Utf8Str::Empty);
     95
     96    i_setVRDEAuthLibrary(Utf8Str::Empty);
     97    i_setDefaultVRDEExtPack(Utf8Str::Empty);
    9898
    9999    m->ulLogHistoryCount = 3;
     
    160160}
    161161
    162 // ISystemProperties properties
     162// wrapped ISystemProperties properties
    163163/////////////////////////////////////////////////////////////////////////////
    164164
    165 
    166 STDMETHODIMP SystemProperties::COMGETTER(MinGuestRAM)(ULONG *minRAM)
    167 {
    168     CheckComArgOutPointerValid(minRAM);
    169 
    170     AutoCaller autoCaller(this);
    171     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    172 
     165HRESULT SystemProperties::getMinGuestRAM(ULONG *minRAM)
     166
     167{
    173168    /* no need to lock, this is const */
    174169    AssertCompile(MM_RAM_MIN_IN_MB >= SchemaDefs::MinGuestRAM);
     
    178173}
    179174
    180 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestRAM)(ULONG *maxRAM)
    181 {
    182     CheckComArgOutPointerValid(maxRAM);
    183 
    184     AutoCaller autoCaller(this);
    185     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    186 
     175HRESULT SystemProperties::getMaxGuestRAM(ULONG *maxRAM)
     176{
    187177    /* no need to lock, this is const */
    188178    AssertCompile(MM_RAM_MAX_IN_MB <= SchemaDefs::MaxGuestRAM);
     
    194184}
    195185
    196 STDMETHODIMP SystemProperties::COMGETTER(MinGuestVRAM)(ULONG *minVRAM)
    197 {
    198     CheckComArgOutPointerValid(minVRAM);
    199 
    200     AutoCaller autoCaller(this);
    201     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    202 
     186HRESULT SystemProperties::getMinGuestVRAM(ULONG *minVRAM)
     187{
    203188    /* no need to lock, this is const */
    204189    *minVRAM = SchemaDefs::MinGuestVRAM;
     
    207192}
    208193
    209 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestVRAM)(ULONG *maxVRAM)
    210 {
    211     CheckComArgOutPointerValid(maxVRAM);
    212 
    213     AutoCaller autoCaller(this);
    214     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    215 
     194HRESULT SystemProperties::getMaxGuestVRAM(ULONG *maxVRAM)
     195{
    216196    /* no need to lock, this is const */
    217197    *maxVRAM = SchemaDefs::MaxGuestVRAM;
     
    220200}
    221201
    222 STDMETHODIMP SystemProperties::COMGETTER(MinGuestCPUCount)(ULONG *minCPUCount)
    223 {
    224     CheckComArgOutPointerValid(minCPUCount);
    225 
    226     AutoCaller autoCaller(this);
    227     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    228 
     202HRESULT SystemProperties::getMinGuestCPUCount(ULONG *minCPUCount)
     203{
    229204    /* no need to lock, this is const */
    230205    *minCPUCount = SchemaDefs::MinCPUCount; // VMM_MIN_CPU_COUNT
     
    233208}
    234209
    235 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestCPUCount)(ULONG *maxCPUCount)
    236 {
    237     CheckComArgOutPointerValid(maxCPUCount);
    238 
    239     AutoCaller autoCaller(this);
    240     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    241 
     210HRESULT SystemProperties::getMaxGuestCPUCount(ULONG *maxCPUCount)
     211{
    242212    /* no need to lock, this is const */
    243213    *maxCPUCount = SchemaDefs::MaxCPUCount; // VMM_MAX_CPU_COUNT
     
    246216}
    247217
    248 STDMETHODIMP SystemProperties::COMGETTER(MaxGuestMonitors)(ULONG *maxMonitors)
    249 {
    250     CheckComArgOutPointerValid(maxMonitors);
    251 
    252     AutoCaller autoCaller(this);
    253     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     218HRESULT SystemProperties::getMaxGuestMonitors(ULONG *maxMonitors)
     219{
    254220
    255221    /* no need to lock, this is const */
     
    259225}
    260226
    261 STDMETHODIMP SystemProperties::COMGETTER(InfoVDSize)(LONG64 *infoVDSize)
    262 {
    263     CheckComArgOutPointerValid(infoVDSize);
    264 
    265     AutoCaller autoCaller(this);
    266     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    267 
     227
     228HRESULT SystemProperties::getInfoVDSize(LONG64 *infoVDSize)
     229{
    268230    /*
    269231     * The BIOS supports currently 32 bit LBA numbers (implementing the full
     
    287249}
    288250
    289 STDMETHODIMP SystemProperties::COMGETTER(SerialPortCount)(ULONG *count)
    290 {
    291     CheckComArgOutPointerValid(count);
    292 
    293     AutoCaller autoCaller(this);
    294     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    295 
     251
     252HRESULT SystemProperties::getSerialPortCount(ULONG *count)
     253{
    296254    /* no need to lock, this is const */
    297255    *count = SchemaDefs::SerialPortCount;
     
    300258}
    301259
    302 STDMETHODIMP SystemProperties::COMGETTER(ParallelPortCount)(ULONG *count)
    303 {
    304     CheckComArgOutPointerValid(count);
    305 
    306     AutoCaller autoCaller(this);
    307     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    308 
     260
     261HRESULT SystemProperties::getParallelPortCount(ULONG *count)
     262{
    309263    /* no need to lock, this is const */
    310264    *count = SchemaDefs::ParallelPortCount;
     
    313267}
    314268
    315 STDMETHODIMP SystemProperties::COMGETTER(MaxBootPosition)(ULONG *aMaxBootPosition)
    316 {
    317     CheckComArgOutPointerValid(aMaxBootPosition);
    318 
    319     AutoCaller autoCaller(this);
    320     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    321 
     269
     270HRESULT SystemProperties::getMaxBootPosition(ULONG *aMaxBootPosition)
     271{
    322272    /* no need to lock, this is const */
    323273    *aMaxBootPosition = SchemaDefs::MaxBootPosition;
     
    327277
    328278
    329 STDMETHODIMP SystemProperties::COMGETTER(ExclusiveHwVirt)(BOOL *aExclusiveHwVirt)
    330 {
    331     CheckComArgOutPointerValid(aExclusiveHwVirt);
    332 
    333     AutoCaller autoCaller(this);
    334     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    335 
     279HRESULT SystemProperties::getExclusiveHwVirt(BOOL *aExclusiveHwVirt)
     280{
    336281    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    337282
     
    341286}
    342287
    343 STDMETHODIMP SystemProperties::COMSETTER(ExclusiveHwVirt)(BOOL aExclusiveHwVirt)
    344 {
    345     AutoCaller autoCaller(this);
    346     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    347 
     288HRESULT SystemProperties::setExclusiveHwVirt(BOOL aExclusiveHwVirt)
     289{
    348290    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    349291    m->fExclusiveHwVirt = !!aExclusiveHwVirt;
     
    357299}
    358300
    359 STDMETHODIMP SystemProperties::GetMaxNetworkAdapters(ChipsetType_T aChipset, ULONG *count)
    360 {
    361     CheckComArgOutPointerValid(count);
    362 
    363     AutoCaller autoCaller(this);
    364     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    365 
     301HRESULT SystemProperties::getMaxNetworkAdapters(ChipsetType_T aChipset, ULONG *aMaxNetworkAdapters)
     302{
    366303    /* no need for locking, no state */
    367304    uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);
    368305    if (uResult == 0)
    369306        AssertMsgFailed(("Invalid chipset type %d\n", aChipset));
    370 
    371     *count = uResult;
    372 
    373     return S_OK;
    374 }
    375 
    376 STDMETHODIMP SystemProperties::GetMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *count)
    377 {
    378     CheckComArgOutPointerValid(count);
    379 
    380     AutoCaller autoCaller(this);
    381     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    382 
     307    *aMaxNetworkAdapters = uResult;
     308    return S_OK;
     309}
     310
     311HRESULT SystemProperties::getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *count)
     312{
    383313    /* no need for locking, no state */
    384314    uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);
     
    409339
    410340
    411 STDMETHODIMP SystemProperties::GetMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
    412                                                                  ULONG *aMaxDevicesPerPort)
    413 {
    414     CheckComArgOutPointerValid(aMaxDevicesPerPort);
    415 
    416     AutoCaller autoCaller(this);
    417     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    418 
     341HRESULT SystemProperties::getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,
     342                                                            ULONG *aMaxDevicesPerPort)
     343{
    419344    /* no need to lock, this is const */
    420345    switch (aBus)
     
    444369}
    445370
    446 STDMETHODIMP SystemProperties::GetMinPortCountForStorageBus(StorageBus_T aBus,
    447                                                             ULONG *aMinPortCount)
    448 {
    449     CheckComArgOutPointerValid(aMinPortCount);
    450 
    451     AutoCaller autoCaller(this);
    452     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    453 
     371HRESULT SystemProperties::getMinPortCountForStorageBus(StorageBus_T aBus,
     372                                                       ULONG *aMinPortCount)
     373{
    454374    /* no need to lock, this is const */
    455375    switch (aBus)
     
    488408}
    489409
    490 STDMETHODIMP SystemProperties::GetMaxPortCountForStorageBus(StorageBus_T aBus,
    491                                                             ULONG *aMaxPortCount)
    492 {
    493     CheckComArgOutPointerValid(aMaxPortCount);
    494 
    495     AutoCaller autoCaller(this);
    496     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    497 
     410HRESULT SystemProperties::getMaxPortCountForStorageBus(StorageBus_T aBus,
     411                                                       ULONG *aMaxPortCount)
     412{
    498413    /* no need to lock, this is const */
    499414    switch (aBus)
     
    536451}
    537452
    538 STDMETHODIMP SystemProperties::GetMaxInstancesOfStorageBus(ChipsetType_T aChipset,
    539                                                            StorageBus_T  aBus,
    540                                                            ULONG *aMaxInstances)
    541 {
    542     CheckComArgOutPointerValid(aMaxInstances);
    543 
    544     AutoCaller autoCaller(this);
    545     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    546 
     453HRESULT SystemProperties::getMaxInstancesOfStorageBus(ChipsetType_T aChipset,
     454                                                      StorageBus_T  aBus,
     455                                                      ULONG *aMaxInstances)
     456{
    547457    ULONG cCtrs = 0;
    548458
     
    571481}
    572482
    573 STDMETHODIMP SystemProperties::GetDeviceTypesForStorageBus(StorageBus_T aBus,
    574                                                            ComSafeArrayOut(DeviceType_T, aDeviceTypes))
    575 {
    576     CheckComArgOutSafeArrayPointerValid(aDeviceTypes);
    577 
    578     AutoCaller autoCaller(this);
    579     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     483HRESULT SystemProperties::getDeviceTypesForStorageBus(StorageBus_T aBus,
     484                                                      std::vector<DeviceType_T> &aDeviceTypes)
     485{
     486    aDeviceTypes.resize(0);
    580487
    581488    /* no need to lock, this is const */
     
    588495        case StorageBus_USB:
    589496        {
    590             com::SafeArray<DeviceType_T> saDeviceTypes(2);
    591             saDeviceTypes[0] = DeviceType_DVD;
    592             saDeviceTypes[1] = DeviceType_HardDisk;
    593             saDeviceTypes.detachTo(ComSafeArrayOutArg(aDeviceTypes));
     497            aDeviceTypes.resize(2);
     498            aDeviceTypes[0] = DeviceType_DVD;
     499            aDeviceTypes[1] = DeviceType_HardDisk;
    594500            break;
    595501        }
    596502        case StorageBus_Floppy:
    597503        {
    598             com::SafeArray<DeviceType_T> saDeviceTypes(1);
    599             saDeviceTypes[0] = DeviceType_Floppy;
    600             saDeviceTypes.detachTo(ComSafeArrayOutArg(aDeviceTypes));
     504            aDeviceTypes.resize(1);
     505            aDeviceTypes[0] = DeviceType_Floppy;
    601506            break;
    602507        }
     
    608513}
    609514
    610 STDMETHODIMP SystemProperties::GetDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType, BOOL *aEnabled)
    611 {
    612     CheckComArgOutPointerValid(aEnabled);
    613 
    614     AutoCaller autoCaller(this);
    615     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    616 
     515HRESULT SystemProperties::getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType,
     516                                                                       BOOL *aEnabled)
     517{
    617518    /* no need to lock, this is const */
    618519    switch (aControllerType)
     
    637538}
    638539
    639 STDMETHODIMP SystemProperties::GetMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
    640                                                                   USBControllerType_T aType,
    641                                                                   ULONG *aMaxInstances)
     540HRESULT SystemProperties::getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
     541                                                             USBControllerType_T aType,
     542                                                             ULONG *aMaxInstances)
    642543{
    643544    NOREF(aChipset);
    644     CheckComArgOutPointerValid(aMaxInstances);
    645 
    646     AutoCaller autoCaller(this);
    647     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    648 
    649545    ULONG cCtrs = 0;
    650546
     
    667563}
    668564
    669 STDMETHODIMP SystemProperties::COMGETTER(DefaultMachineFolder)(BSTR *aDefaultMachineFolder)
    670 {
    671     CheckComArgOutPointerValid(aDefaultMachineFolder);
    672 
    673     AutoCaller autoCaller(this);
    674     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    675 
    676     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    677 
    678     m->strDefaultMachineFolder.cloneTo(aDefaultMachineFolder);
    679 
    680     return S_OK;
    681 }
    682 
    683 STDMETHODIMP SystemProperties::COMSETTER(DefaultMachineFolder)(IN_BSTR aDefaultMachineFolder)
    684 {
    685     AutoCaller autoCaller(this);
    686     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    687 
     565HRESULT SystemProperties::getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder)
     566{
     567    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     568    aDefaultMachineFolder = m->strDefaultMachineFolder;
     569    return S_OK;
     570}
     571
     572HRESULT SystemProperties::setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder)
     573{
    688574    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    689     HRESULT rc = setDefaultMachineFolder(aDefaultMachineFolder);
     575    HRESULT rc = i_setDefaultMachineFolder(aDefaultMachineFolder);
    690576    alock.release();
    691 
    692577    if (SUCCEEDED(rc))
    693578    {
     
    700585}
    701586
    702 STDMETHODIMP SystemProperties::COMGETTER(LoggingLevel)(BSTR *aLoggingLevel)
    703 {
    704     CheckComArgOutPointerValid(aLoggingLevel);
    705 
    706     AutoCaller autoCaller(this);
    707     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    708 
    709     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    710 
    711     Utf8Str useLoggingLevel(m->strLoggingLevel);
    712     if (useLoggingLevel.isEmpty())
    713         useLoggingLevel = VBOXSVC_LOG_DEFAULT;
    714 
    715     useLoggingLevel.cloneTo(aLoggingLevel);
    716     return S_OK;
    717 }
    718 
    719 
    720 STDMETHODIMP SystemProperties::COMSETTER(LoggingLevel)(IN_BSTR aLoggingLevel)
    721 {
    722     AutoCaller autoCaller(this);
    723     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    724 
     587HRESULT SystemProperties::getLoggingLevel(com::Utf8Str &aLoggingLevel)
     588{
     589    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     590
     591    aLoggingLevel = m->strLoggingLevel;
     592
     593    if (aLoggingLevel.isEmpty())
     594        aLoggingLevel = VBOXSVC_LOG_DEFAULT;
     595
     596    return S_OK;
     597}
     598
     599
     600HRESULT SystemProperties::setLoggingLevel(const com::Utf8Str &aLoggingLevel)
     601{
    725602    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    726     HRESULT rc = setLoggingLevel(aLoggingLevel);
     603    HRESULT rc = i_setLoggingLevel(aLoggingLevel);
    727604    alock.release();
    728605
     
    733610    }
    734611    else
    735         LogRel(("Cannot set passed logging level=%ls, or the default one - Error=%Rhrc \n", aLoggingLevel, rc));
     612        LogRel(("Cannot set passed logging level=%ls, or the default one - Error=%Rhrc \n", Bstr(aLoggingLevel).raw(), rc));
    736613
    737614    return rc;
    738615}
    739616
    740 STDMETHODIMP SystemProperties::COMGETTER(MediumFormats)(ComSafeArrayOut(IMediumFormat *, aMediumFormats))
    741 {
    742     CheckComArgOutSafeArrayPointerValid(aMediumFormats);
    743 
    744     AutoCaller autoCaller(this);
    745     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    746 
    747     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    748 
    749     SafeIfaceArray<IMediumFormat> mediumFormats(m_llMediumFormats);
    750     mediumFormats.detachTo(ComSafeArrayOutArg(aMediumFormats));
    751 
    752     return S_OK;
    753 }
    754 
    755 STDMETHODIMP SystemProperties::COMGETTER(DefaultHardDiskFormat)(BSTR *aDefaultHardDiskFormat)
    756 {
    757     CheckComArgOutPointerValid(aDefaultHardDiskFormat);
    758 
    759     AutoCaller autoCaller(this);
    760     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    761 
    762     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    763 
    764     m->strDefaultHardDiskFormat.cloneTo(aDefaultHardDiskFormat);
    765 
    766     return S_OK;
    767 }
    768 
    769 STDMETHODIMP SystemProperties::COMSETTER(DefaultHardDiskFormat)(IN_BSTR aDefaultHardDiskFormat)
    770 {
    771     AutoCaller autoCaller(this);
    772     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    773 
     617HRESULT SystemProperties::getMediumFormats(std::vector<ComPtr<IMediumFormat> > &aMediumFormats)
     618{
     619    MediumFormatList mediumFormats(m_llMediumFormats);
     620    aMediumFormats.resize(mediumFormats.size());
     621    size_t i = 0;
     622    for (MediumFormatList::const_iterator it = mediumFormats.begin(); it != mediumFormats.end(); ++it, ++i)
     623        (*it).queryInterfaceTo(aMediumFormats[i].asOutParam());
     624    return S_OK;
     625}
     626
     627HRESULT SystemProperties::getDefaultHardDiskFormat(com::Utf8Str &aDefaultHardDiskFormat)
     628{
     629    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     630    aDefaultHardDiskFormat = m->strDefaultHardDiskFormat;
     631    return S_OK;
     632}
     633
     634
     635HRESULT SystemProperties::setDefaultHardDiskFormat(const com::Utf8Str &aDefaultHardDiskFormat)
     636{
    774637    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    775     HRESULT rc = setDefaultHardDiskFormat(aDefaultHardDiskFormat);
     638    HRESULT rc = i_setDefaultHardDiskFormat(aDefaultHardDiskFormat);
    776639    alock.release();
    777 
    778640    if (SUCCEEDED(rc))
    779641    {
     
    786648}
    787649
    788 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceWarning)(LONG64 *aFreeSpace)
    789 {
    790     CheckComArgOutPointerValid(aFreeSpace);
    791 
     650HRESULT SystemProperties::getFreeDiskSpaceWarning(LONG64 *aFreeSpace)
     651{
     652    NOREF(aFreeSpace);
    792653    ReturnComNotImplemented();
    793654}
    794655
    795 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceWarning)(LONG64 /* aFreeSpace */)
     656HRESULT SystemProperties::setFreeDiskSpaceWarning(LONG64 /* aFreeSpace */)
    796657{
    797658    ReturnComNotImplemented();
    798659}
    799660
    800 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentWarning)(ULONG *aFreeSpacePercent)
    801 {
    802     CheckComArgOutPointerValid(aFreeSpacePercent);
    803 
     661HRESULT SystemProperties::getFreeDiskSpacePercentWarning(ULONG *aFreeSpacePercent)
     662{
     663    NOREF(aFreeSpacePercent);
    804664    ReturnComNotImplemented();
    805665}
    806666
    807 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentWarning)(ULONG /* aFreeSpacePercent */)
     667HRESULT SystemProperties::setFreeDiskSpacePercentWarning(ULONG /* aFreeSpacePercent */)
    808668{
    809669    ReturnComNotImplemented();
    810670}
    811671
    812 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpaceError)(LONG64 *aFreeSpace)
    813 {
    814     CheckComArgOutPointerValid(aFreeSpace);
    815 
     672HRESULT SystemProperties::getFreeDiskSpaceError(LONG64 *aFreeSpace)
     673{
     674    NOREF(aFreeSpace);
    816675    ReturnComNotImplemented();
    817676}
    818677
    819 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpaceError)(LONG64 /* aFreeSpace */)
     678HRESULT SystemProperties::setFreeDiskSpaceError(LONG64 /* aFreeSpace */)
    820679{
    821680    ReturnComNotImplemented();
    822681}
    823682
    824 STDMETHODIMP SystemProperties::COMGETTER(FreeDiskSpacePercentError)(ULONG *aFreeSpacePercent)
    825 {
    826     CheckComArgOutPointerValid(aFreeSpacePercent);
    827 
     683HRESULT SystemProperties::getFreeDiskSpacePercentError(ULONG *aFreeSpacePercent)
     684{
     685    NOREF(aFreeSpacePercent);
    828686    ReturnComNotImplemented();
    829687}
    830688
    831 STDMETHODIMP SystemProperties::COMSETTER(FreeDiskSpacePercentError)(ULONG /* aFreeSpacePercent */)
     689HRESULT SystemProperties::setFreeDiskSpacePercentError(ULONG /* aFreeSpacePercent */)
    832690{
    833691    ReturnComNotImplemented();
    834692}
    835693
    836 STDMETHODIMP SystemProperties::COMGETTER(VRDEAuthLibrary)(BSTR *aVRDEAuthLibrary)
    837 {
    838     CheckComArgOutPointerValid(aVRDEAuthLibrary);
    839 
    840     AutoCaller autoCaller(this);
    841     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    842 
    843     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    844 
    845     m->strVRDEAuthLibrary.cloneTo(aVRDEAuthLibrary);
    846 
    847     return S_OK;
    848 }
    849 
    850 STDMETHODIMP SystemProperties::COMSETTER(VRDEAuthLibrary)(IN_BSTR aVRDEAuthLibrary)
    851 {
    852     AutoCaller autoCaller(this);
    853     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    854 
     694HRESULT SystemProperties::getVRDEAuthLibrary(com::Utf8Str &aVRDEAuthLibrary)
     695{
     696    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     697
     698    aVRDEAuthLibrary = m->strVRDEAuthLibrary;
     699
     700    return S_OK;
     701}
     702
     703HRESULT SystemProperties::setVRDEAuthLibrary(const com::Utf8Str &aVRDEAuthLibrary)
     704{
    855705    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    856     HRESULT rc = setVRDEAuthLibrary(aVRDEAuthLibrary);
     706    HRESULT rc = i_setVRDEAuthLibrary(aVRDEAuthLibrary);
    857707    alock.release();
    858 
    859708    if (SUCCEEDED(rc))
    860709    {
     
    867716}
    868717
    869 STDMETHODIMP SystemProperties::COMGETTER(WebServiceAuthLibrary)(BSTR *aWebServiceAuthLibrary)
    870 {
    871     CheckComArgOutPointerValid(aWebServiceAuthLibrary);
    872 
    873     AutoCaller autoCaller(this);
    874     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    875 
    876     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    877 
    878     m->strWebServiceAuthLibrary.cloneTo(aWebServiceAuthLibrary);
    879 
    880     return S_OK;
    881 }
    882 
    883 STDMETHODIMP SystemProperties::COMSETTER(WebServiceAuthLibrary)(IN_BSTR aWebServiceAuthLibrary)
    884 {
    885     AutoCaller autoCaller(this);
    886     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    887 
     718HRESULT SystemProperties::getWebServiceAuthLibrary(com::Utf8Str &aWebServiceAuthLibrary)
     719{
     720    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     721
     722    aWebServiceAuthLibrary = m->strWebServiceAuthLibrary;
     723
     724    return S_OK;
     725}
     726
     727HRESULT SystemProperties::setWebServiceAuthLibrary(const com::Utf8Str &aWebServiceAuthLibrary)
     728{
    888729    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    889     HRESULT rc = setWebServiceAuthLibrary(aWebServiceAuthLibrary);
     730    HRESULT rc = i_setWebServiceAuthLibrary(aWebServiceAuthLibrary);
    890731    alock.release();
    891732
     
    900741}
    901742
    902 STDMETHODIMP SystemProperties::COMGETTER(DefaultVRDEExtPack)(BSTR *aExtPack)
    903 {
    904     CheckComArgOutPointerValid(aExtPack);
    905 
    906     AutoCaller autoCaller(this);
    907     HRESULT hrc = autoCaller.rc();
     743HRESULT SystemProperties::getDefaultVRDEExtPack(com::Utf8Str &aExtPack)
     744{
     745    HRESULT hrc = S_OK;
     746    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     747    Utf8Str strExtPack(m->strDefaultVRDEExtPack);
     748    if (strExtPack.isNotEmpty())
     749    {
     750        if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
     751            hrc = S_OK;
     752        else
     753#ifdef VBOX_WITH_EXTPACK
     754            hrc = mParent->getExtPackManager()->checkVrdeExtPack(&strExtPack);
     755#else
     756            hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), strExtPack.c_str());
     757#endif
     758    }
     759    else
     760    {
     761#ifdef VBOX_WITH_EXTPACK
     762        hrc = mParent->getExtPackManager()->getDefaultVrdeExtPack(&strExtPack);
     763#endif
     764        if (strExtPack.isEmpty())
     765        {
     766            /*
     767            * Klugde - check if VBoxVRDP.dll/.so/.dylib is installed.
     768            * This is hardcoded uglyness, sorry.
     769            */
     770            char szPath[RTPATH_MAX];
     771            int vrc = RTPathAppPrivateArch(szPath, sizeof(szPath));
     772            if (RT_SUCCESS(vrc))
     773                vrc = RTPathAppend(szPath, sizeof(szPath), "VBoxVRDP");
     774            if (RT_SUCCESS(vrc))
     775                vrc = RTStrCat(szPath, sizeof(szPath), RTLdrGetSuff());
     776            if (RT_SUCCESS(vrc) && RTFileExists(szPath))
     777            {
     778                /* Illegal extpack name, so no conflict. */
     779                strExtPack = VBOXVRDP_KLUDGE_EXTPACK_NAME;
     780            }
     781        }
     782    }
     783
    908784    if (SUCCEEDED(hrc))
    909     {
    910         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    911         Utf8Str strExtPack(m->strDefaultVRDEExtPack);
    912         if (strExtPack.isNotEmpty())
    913         {
    914             if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
    915                 hrc = S_OK;
    916             else
     785          aExtPack = strExtPack;
     786
     787    return S_OK;
     788}
     789
     790
     791HRESULT SystemProperties::setDefaultVRDEExtPack(const com::Utf8Str &aExtPack)
     792{
     793    HRESULT hrc = S_OK;
     794    if (aExtPack.isNotEmpty())
     795    {
     796        if (aExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
     797            hrc = S_OK;
     798        else
    917799#ifdef VBOX_WITH_EXTPACK
    918                 hrc = mParent->getExtPackManager()->checkVrdeExtPack(&strExtPack);
     800            hrc = mParent->getExtPackManager()->checkVrdeExtPack(&aExtPack);
    919801#else
    920                 hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), strExtPack.c_str());
     802            hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), aExtPack.c_str());
    921803#endif
    922         }
    923         else
    924         {
    925 #ifdef VBOX_WITH_EXTPACK
    926             hrc = mParent->getExtPackManager()->getDefaultVrdeExtPack(&strExtPack);
    927 #endif
    928             if (strExtPack.isEmpty())
    929             {
    930                 /*
    931                  * Klugde - check if VBoxVRDP.dll/.so/.dylib is installed.
    932                  * This is hardcoded uglyness, sorry.
    933                  */
    934                 char szPath[RTPATH_MAX];
    935                 int vrc = RTPathAppPrivateArch(szPath, sizeof(szPath));
    936                 if (RT_SUCCESS(vrc))
    937                     vrc = RTPathAppend(szPath, sizeof(szPath), "VBoxVRDP");
    938                 if (RT_SUCCESS(vrc))
    939                     vrc = RTStrCat(szPath, sizeof(szPath), RTLdrGetSuff());
    940                 if (RT_SUCCESS(vrc) && RTFileExists(szPath))
    941                 {
    942                     /* Illegal extpack name, so no conflict. */
    943                     strExtPack = VBOXVRDP_KLUDGE_EXTPACK_NAME;
    944                 }
    945             }
    946         }
    947 
     804    }
     805    if (SUCCEEDED(hrc))
     806    {
     807        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     808        hrc = i_setDefaultVRDEExtPack(aExtPack);
    948809        if (SUCCEEDED(hrc))
    949             strExtPack.cloneTo(aExtPack);
    950     }
    951 
    952     return S_OK;
    953 }
    954 
    955 STDMETHODIMP SystemProperties::COMSETTER(DefaultVRDEExtPack)(IN_BSTR aExtPack)
    956 {
    957     CheckComArgNotNull(aExtPack);
    958     Utf8Str strExtPack(aExtPack);
    959 
    960     AutoCaller autoCaller(this);
    961     HRESULT hrc = autoCaller.rc();
    962     if (SUCCEEDED(hrc))
    963     {
    964         if (strExtPack.isNotEmpty())
    965         {
    966             if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
    967                 hrc = S_OK;
    968             else
    969 #ifdef VBOX_WITH_EXTPACK
    970                 hrc = mParent->getExtPackManager()->checkVrdeExtPack(&strExtPack);
    971 #else
    972                 hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), strExtPack.c_str());
    973 #endif
    974         }
    975         if (SUCCEEDED(hrc))
    976         {
    977             AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    978             hrc = setDefaultVRDEExtPack(aExtPack);
    979             if (SUCCEEDED(hrc))
    980             {
    981                 /* VirtualBox::saveSettings() needs the VirtualBox write lock. */
    982                 alock.release();
    983                 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);
    984                 hrc = mParent->saveSettings();
    985             }
     810        {
     811            /* VirtualBox::saveSettings() needs the VirtualBox write lock. */
     812            alock.release();
     813            AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);
     814            hrc = mParent->saveSettings();
    986815        }
    987816    }
     
    990819}
    991820
    992 STDMETHODIMP SystemProperties::COMGETTER(LogHistoryCount)(ULONG *count)
    993 {
    994     CheckComArgOutPointerValid(count);
    995 
    996     AutoCaller autoCaller(this);
    997     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    998 
     821
     822HRESULT SystemProperties::getLogHistoryCount(ULONG *count)
     823{
    999824    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1000825
     
    1004829}
    1005830
    1006 STDMETHODIMP SystemProperties::COMSETTER(LogHistoryCount)(ULONG count)
    1007 {
    1008     AutoCaller autoCaller(this);
    1009     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1010 
     831
     832HRESULT SystemProperties::setLogHistoryCount(ULONG count)
     833{
    1011834    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1012835    m->ulLogHistoryCount = count;
     
    1020843}
    1021844
    1022 STDMETHODIMP SystemProperties::COMGETTER(DefaultAudioDriver)(AudioDriverType_T *aAudioDriver)
    1023 {
    1024     CheckComArgOutPointerValid(aAudioDriver);
    1025 
    1026     AutoCaller autoCaller(this);
    1027     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1028 
     845HRESULT SystemProperties::getDefaultAudioDriver(AudioDriverType_T *aAudioDriver)
     846{
    1029847    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1030848
     
    1034852}
    1035853
    1036 STDMETHODIMP SystemProperties::COMGETTER(AutostartDatabasePath)(BSTR *aAutostartDbPath)
    1037 {
    1038     CheckComArgOutPointerValid(aAutostartDbPath);
    1039 
    1040     AutoCaller autoCaller(this);
    1041     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1042 
    1043     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1044 
    1045     m->strAutostartDatabasePath.cloneTo(aAutostartDbPath);
    1046 
    1047     return S_OK;
    1048 }
    1049 
    1050 STDMETHODIMP SystemProperties::COMSETTER(AutostartDatabasePath)(IN_BSTR aAutostartDbPath)
    1051 {
    1052     AutoCaller autoCaller(this);
    1053     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1054 
     854HRESULT SystemProperties::getAutostartDatabasePath(com::Utf8Str &aAutostartDbPath)
     855{
     856    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     857
     858    aAutostartDbPath = m->strAutostartDatabasePath;
     859
     860    return S_OK;
     861}
     862
     863HRESULT SystemProperties::setAutostartDatabasePath(const com::Utf8Str &aAutostartDbPath)
     864{
    1055865    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1056     HRESULT rc = setAutostartDatabasePath(aAutostartDbPath);
     866    HRESULT rc = i_setAutostartDatabasePath(aAutostartDbPath);
    1057867    alock.release();
    1058868
     
    1067877}
    1068878
    1069 STDMETHODIMP SystemProperties::COMGETTER(DefaultAdditionsISO)(BSTR *aDefaultAdditionsISO)
    1070 {
    1071     CheckComArgOutPointerValid(aDefaultAdditionsISO);
    1072 
    1073     AutoCaller autoCaller(this);
    1074     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1075 
     879HRESULT SystemProperties::getDefaultAdditionsISO(com::Utf8Str &aDefaultAdditionsISO)
     880{
    1076881    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1077882
     
    1087892        alock.acquire();
    1088893    }
    1089     m->strDefaultAdditionsISO.cloneTo(aDefaultAdditionsISO);
    1090 
    1091     return S_OK;
    1092 }
    1093 
    1094 STDMETHODIMP SystemProperties::COMSETTER(DefaultAdditionsISO)(IN_BSTR aDefaultAdditionsISO)
    1095 {
    1096     AutoCaller autoCaller(this);
    1097     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1098 
     894    aDefaultAdditionsISO = m->strDefaultAdditionsISO;
     895
     896    return S_OK;
     897}
     898
     899HRESULT SystemProperties::setDefaultAdditionsISO(const com::Utf8Str &aDefaultAdditionsISO)
     900{
    1099901    /** @todo not yet implemented, settings handling is missing */
    1100902    ReturnComNotImplemented();
     
    1114916}
    1115917
    1116 STDMETHODIMP SystemProperties::COMGETTER(DefaultFrontend)(BSTR *aDefaultFrontend)
    1117 {
    1118     CheckComArgOutPointerValid(aDefaultFrontend);
    1119 
    1120     AutoCaller autoCaller(this);
    1121     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1122 
    1123     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1124     m->strDefaultFrontend.cloneTo(aDefaultFrontend);
    1125 
    1126     return S_OK;
    1127 }
    1128 
    1129 STDMETHODIMP SystemProperties::COMSETTER(DefaultFrontend)(IN_BSTR aDefaultFrontend)
    1130 {
    1131     AutoCaller autoCaller(this);
    1132     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1133 
     918HRESULT SystemProperties::getDefaultFrontend(com::Utf8Str &aDefaultFrontend)
     919{
     920    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     921    aDefaultFrontend = m->strDefaultFrontend;
     922    return S_OK;
     923}
     924
     925HRESULT SystemProperties::setDefaultFrontend(const com::Utf8Str &aDefaultFrontend)
     926{
    1134927    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1135928    if (m->strDefaultFrontend == Utf8Str(aDefaultFrontend))
     
    1151944/////////////////////////////////////////////////////////////////////////////
    1152945
    1153 HRESULT SystemProperties::loadSettings(const settings::SystemProperties &data)
     946HRESULT SystemProperties::i_loadSettings(const settings::SystemProperties &data)
    1154947{
    1155948    AutoCaller autoCaller(this);
     
    1157950
    1158951    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1159 
    1160952    HRESULT rc = S_OK;
    1161 
    1162     rc = setDefaultMachineFolder(data.strDefaultMachineFolder);
     953    rc = i_setDefaultMachineFolder(data.strDefaultMachineFolder);
    1163954    if (FAILED(rc)) return rc;
    1164955
    1165     rc = setLoggingLevel(data.strLoggingLevel);
     956    rc = i_setLoggingLevel(data.strLoggingLevel);
    1166957    if (FAILED(rc)) return rc;
    1167958
    1168     rc = setDefaultHardDiskFormat(data.strDefaultHardDiskFormat);
     959    rc = i_setDefaultHardDiskFormat(data.strDefaultHardDiskFormat);
    1169960    if (FAILED(rc)) return rc;
    1170961
    1171     rc = setVRDEAuthLibrary(data.strVRDEAuthLibrary);
     962    rc = i_setVRDEAuthLibrary(data.strVRDEAuthLibrary);
    1172963    if (FAILED(rc)) return rc;
    1173964
    1174     rc = setWebServiceAuthLibrary(data.strWebServiceAuthLibrary);
     965    rc = i_setWebServiceAuthLibrary(data.strWebServiceAuthLibrary);
    1175966    if (FAILED(rc)) return rc;
    1176967
    1177     rc = setDefaultVRDEExtPack(data.strDefaultVRDEExtPack);
     968    rc = i_setDefaultVRDEExtPack(data.strDefaultVRDEExtPack);
    1178969    if (FAILED(rc)) return rc;
    1179970
     
    1181972    m->fExclusiveHwVirt  = data.fExclusiveHwVirt;
    1182973
    1183     rc = setAutostartDatabasePath(data.strAutostartDatabasePath);
     974    rc = i_setAutostartDatabasePath(data.strAutostartDatabasePath);
    1184975    if (FAILED(rc)) return rc;
    1185976
     
    1188979         * file may not exist, and in this case keep the empty string */
    1189980        ErrorInfoKeeper eik;
    1190         (void)setDefaultAdditionsISO(data.strDefaultAdditionsISO);
    1191     }
    1192 
    1193     rc = setDefaultFrontend(data.strDefaultFrontend);
     981        (void)i_setDefaultAdditionsISO(data.strDefaultAdditionsISO);
     982    }
     983
     984    rc = i_setDefaultFrontend(data.strDefaultFrontend);
    1194985    if (FAILED(rc)) return rc;
    1195986
     
    1197988}
    1198989
    1199 HRESULT SystemProperties::saveSettings(settings::SystemProperties &data)
     990HRESULT SystemProperties::i_saveSettings(settings::SystemProperties &data)
    1200991{
    1201992    AutoCaller autoCaller(this);
     
    12171008 * @return ComObjPtr<MediumFormat>
    12181009 */
    1219 ComObjPtr<MediumFormat> SystemProperties::mediumFormat(const Utf8Str &aFormat)
     1010ComObjPtr<MediumFormat> SystemProperties::i_mediumFormat(const Utf8Str &aFormat)
    12201011{
    12211012    ComObjPtr<MediumFormat> format;
     
    12501041 * @return ComObjPtr<MediumFormat>
    12511042 */
    1252 ComObjPtr<MediumFormat> SystemProperties::mediumFormatFromExtension(const Utf8Str &aExt)
     1043ComObjPtr<MediumFormat> SystemProperties::i_mediumFormatFromExtension(const Utf8Str &aExt)
    12531044{
    12541045    ComObjPtr<MediumFormat> format;
     
    12901081 * @return
    12911082 */
    1292 HRESULT SystemProperties::getUserHomeDirectory(Utf8Str &strPath)
     1083HRESULT SystemProperties::i_getUserHomeDirectory(Utf8Str &strPath)
    12931084{
    12941085    char szHome[RTPATH_MAX];
     
    13101101 * @return
    13111102 */
    1312 HRESULT SystemProperties::setDefaultMachineFolder(const Utf8Str &strPath)
     1103HRESULT SystemProperties::i_setDefaultMachineFolder(const Utf8Str &strPath)
    13131104{
    13141105    Utf8Str path(strPath);      // make modifiable
     
    13201111    {
    13211112        // new default with VirtualBox 4.0: "$HOME/VirtualBox VMs"
    1322         HRESULT rc = getUserHomeDirectory(path);
     1113        HRESULT rc = i_getUserHomeDirectory(path);
    13231114        if (FAILED(rc)) return rc;
    13241115        path += RTPATH_SLASH_STR "VirtualBox VMs";
     
    13351126}
    13361127
    1337 HRESULT SystemProperties::setLoggingLevel(const Utf8Str &aLoggingLevel)
     1128HRESULT SystemProperties::i_setLoggingLevel(const com::Utf8Str &aLoggingLevel)
    13381129{
    13391130    Utf8Str useLoggingLevel(aLoggingLevel);
     
    13601151}
    13611152
    1362 HRESULT SystemProperties::setDefaultHardDiskFormat(const Utf8Str &aFormat)
     1153HRESULT SystemProperties::i_setDefaultHardDiskFormat(const com::Utf8Str &aFormat)
    13631154{
    13641155    if (!aFormat.isEmpty())
     
    13701161}
    13711162
    1372 HRESULT SystemProperties::setVRDEAuthLibrary(const Utf8Str &aPath)
     1163HRESULT SystemProperties::i_setVRDEAuthLibrary(const com::Utf8Str &aPath)
    13731164{
    13741165    if (!aPath.isEmpty())
     
    13801171}
    13811172
    1382 HRESULT SystemProperties::setWebServiceAuthLibrary(const Utf8Str &aPath)
     1173HRESULT SystemProperties::i_setWebServiceAuthLibrary(const com::Utf8Str &aPath)
    13831174{
    13841175    if (!aPath.isEmpty())
     
    13901181}
    13911182
    1392 HRESULT SystemProperties::setDefaultVRDEExtPack(const Utf8Str &aExtPack)
     1183HRESULT SystemProperties::i_setDefaultVRDEExtPack(const com::Utf8Str &aExtPack)
    13931184{
    13941185    m->strDefaultVRDEExtPack = aExtPack;
     
    13971188}
    13981189
    1399 HRESULT SystemProperties::setAutostartDatabasePath(const Utf8Str &aPath)
     1190HRESULT SystemProperties::i_setAutostartDatabasePath(const com::Utf8Str &aPath)
    14001191{
    14011192    HRESULT rc = S_OK;
     
    14271218}
    14281219
    1429 HRESULT SystemProperties::setDefaultAdditionsISO(const Utf8Str &aPath)
    1430 {
    1431     Utf8Str path(aPath);
     1220HRESULT SystemProperties::i_setDefaultAdditionsISO(const com::Utf8Str &aPath)
     1221{
     1222    com::Utf8Str path(aPath);
    14321223    if (path.isEmpty())
    14331224    {
     
    14431234        vrc = RTPathUserHome(strTemp, sizeof(strTemp));
    14441235        AssertRC(vrc);
    1445         Utf8Str strSrc3 = Utf8StrFmt("%s/VBoxGuestAdditions_%ls.iso", strTemp, VirtualBox::getVersionNormalized().raw());
     1236        Utf8Str strSrc3 = Utf8StrFmt("%s/VBoxGuestAdditions_%ls.iso", strTemp, Bstr(VirtualBox::getVersionNormalized()).raw());
    14461237
    14471238        /* Check the standard image locations */
     
    14721263}
    14731264
    1474 HRESULT SystemProperties::setDefaultFrontend(const Utf8Str &aDefaultFrontend)
     1265HRESULT SystemProperties::i_setDefaultFrontend(const com::Utf8Str &aDefaultFrontend)
    14751266{
    14761267    m->strDefaultFrontend = aDefaultFrontend;
  • trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp

    r49742 r49951  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4141 *  @param  aStr        The output string.
    4242 */
    43 static void usbFilterFieldToString(PCUSBFILTER aFilter, USBFILTERIDX aIdx, Utf8Str &out)
     43static void i_usbFilterFieldToString(PCUSBFILTER aFilter, USBFILTERIDX aIdx, Utf8Str &out)
    4444{
    4545    const USBFILTERMATCH matchingMethod = USBFilterGetMatchingMethod(aFilter, aIdx);
     
    6262
    6363/*static*/
    64 const char* USBDeviceFilter::describeUSBFilterIdx(USBFILTERIDX aIdx)
     64const char* USBDeviceFilter::i_describeUSBFilterIdx(USBFILTERIDX aIdx)
    6565{
    6666    switch (aIdx)
     
    9292 *  @remark The idea was to have this as a static function, but tr() doesn't wanna work without a class :-/
    9393 */
    94 /*static*/ HRESULT USBDeviceFilter::usbFilterFieldFromString(PUSBFILTER aFilter,
    95                                                              USBFILTERIDX aIdx,
    96                                                              const Utf8Str &aValue,
    97                                                              Utf8Str &aErrStr)
     94/*static*/ HRESULT USBDeviceFilter::i_usbFilterFieldFromString(PUSBFILTER aFilter,
     95                                                               USBFILTERIDX aIdx,
     96                                                               const Utf8Str &aValue,
     97                                                               Utf8Str &aErrStr)
    9898{
    9999    int vrc;
    100 //     Utf8Str str (aStr);
    101100    if (aValue.isEmpty())
    102101        vrc = USBFilterSetIgnore(aFilter, aIdx);
     
    123122                    else
    124123                    {
    125                         aErrStr = Utf8StrFmt(tr("The %s value '%s' is too big (max 0xFFFF)"), describeUSBFilterIdx(aIdx), pcszValue);
     124                        aErrStr = Utf8StrFmt(tr("The %s value '%s' is too big (max 0xFFFF)"), i_describeUSBFilterIdx(aIdx), pcszValue);
    126125                        return E_INVALIDARG;
    127126                    }
     
    151150        if (vrc == VERR_INVALID_PARAMETER)
    152151        {
    153             aErrStr = Utf8StrFmt(tr("The %s filter expression '%s' is not valid"), describeUSBFilterIdx(aIdx), aValue.c_str());
     152            aErrStr = Utf8StrFmt(tr("The %s filter expression '%s' is not valid"), i_describeUSBFilterIdx(aIdx), aValue.c_str());
    154153            return E_INVALIDARG;
    155154        }
    156155        if (vrc == VERR_BUFFER_OVERFLOW)
    157156        {
    158             aErrStr = Utf8StrFmt(tr("Insufficient expression space for the '%s' filter expression '%s'"), describeUSBFilterIdx(aIdx), aValue.c_str());
     157            aErrStr = Utf8StrFmt(tr("Insufficient expression space for the '%s' filter expression '%s'"), i_describeUSBFilterIdx(aIdx), aValue.c_str());
    159158            return E_FAIL;
    160159        }
    161160        AssertRC(vrc);
    162         aErrStr = Utf8StrFmt(tr("Encountered unexpected status %Rrc when setting '%s' to '%s'"), vrc, describeUSBFilterIdx(aIdx), aValue.c_str());
     161        aErrStr = Utf8StrFmt(tr("Encountered unexpected status %Rrc when setting '%s' to '%s'"), vrc, i_describeUSBFilterIdx(aIdx), aValue.c_str());
    163162        return E_FAIL;
    164163    }
     
    237236    do
    238237    {
    239         rc = usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId);
    240         if (FAILED(rc)) break;
    241 
    242         rc = usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId);
    243         if (FAILED(rc)) break;
    244 
    245         rc = usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision);
    246         if (FAILED(rc)) break;
    247 
    248         rc = usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
    249         if (FAILED(rc)) break;
    250 
    251         rc = usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, data.strProduct);
    252         if (FAILED(rc)) break;
    253 
    254         rc = usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
    255         if (FAILED(rc)) break;
    256 
    257         rc = usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort);
     238        rc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId);
     239        if (FAILED(rc)) break;
     240
     241        rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId);
     242        if (FAILED(rc)) break;
     243
     244        rc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision);
     245        if (FAILED(rc)) break;
     246
     247        rc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
     248        if (FAILED(rc)) break;
     249
     250        rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, data.strProduct);
     251        if (FAILED(rc)) break;
     252
     253        rc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
     254        if (FAILED(rc)) break;
     255
     256        rc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort);
    258257        if (FAILED(rc)) break;
    259258
     
    440439////////////////////////////////////////////////////////////////////////////////
    441440
    442 STDMETHODIMP USBDeviceFilter::COMGETTER(Name) (BSTR *aName)
    443 {
    444     CheckComArgOutPointerValid(aName);
    445 
    446     AutoCaller autoCaller(this);
    447     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    448 
     441HRESULT USBDeviceFilter::getName(com::Utf8Str &aName)
     442{
    449443    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    450444
    451     mData->mName.cloneTo(aName);
    452 
    453     return S_OK;
    454 }
    455 
    456 STDMETHODIMP USBDeviceFilter::COMSETTER(Name) (IN_BSTR aName)
    457 {
    458     CheckComArgStrNotEmptyOrNull(aName);
    459 
    460     AutoCaller autoCaller(this);
    461     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    462 
     445    aName = mData->mName;
     446
     447    return S_OK;
     448}
     449
     450HRESULT USBDeviceFilter::setName(const com::Utf8Str &aName)
     451{
    463452    /* the machine needs to be mutable */
    464     AutoMutableStateDependency adep(mParent->getMachine());
     453    AutoMutableStateDependency adep(mParent->i_getMachine());
    465454    if (FAILED(adep.rc())) return adep.rc();
    466455
     
    470459    {
    471460        m_fModified = true;
    472         ComObjPtr<Machine> pMachine = mParent->getMachine();
     461        ComObjPtr<Machine> pMachine = mParent->i_getMachine();
    473462
    474463        mData.backup();
     
    482471        mlock.release();
    483472
    484         return mParent->onDeviceFilterChange(this);
    485     }
    486 
    487     return S_OK;
    488 }
    489 
    490 STDMETHODIMP USBDeviceFilter::COMGETTER(Active) (BOOL *aActive)
    491 {
    492     CheckComArgOutPointerValid(aActive);
    493 
    494     AutoCaller autoCaller(this);
    495     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    496 
     473        return mParent->i_onDeviceFilterChange(this);
     474    }
     475
     476    return S_OK;
     477}
     478
     479HRESULT USBDeviceFilter::getActive(BOOL *aActive)
     480{
    497481    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    498482
     
    502486}
    503487
    504 STDMETHODIMP USBDeviceFilter::COMSETTER(Active) (BOOL aActive)
    505 {
    506     AutoCaller autoCaller(this);
    507     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    508 
     488HRESULT USBDeviceFilter::setActive(const BOOL aActive)
     489{
    509490    /* the machine needs to be mutable */
    510     AutoMutableStateDependency adep(mParent->getMachine());
     491    AutoMutableStateDependency adep(mParent->i_getMachine());
    511492    if (FAILED(adep.rc())) return adep.rc();
    512493
     
    516497    {
    517498        m_fModified = true;
    518         ComObjPtr<Machine> pMachine = mParent->getMachine();
     499        ComObjPtr<Machine> pMachine = mParent->i_getMachine();
    519500
    520501        mData.backup();
     
    528509        mlock.release();
    529510
    530         return mParent->onDeviceFilterChange(this, TRUE /* aActiveChanged */);
    531     }
    532 
    533     return S_OK;
    534 }
    535 
    536 STDMETHODIMP USBDeviceFilter::COMGETTER(VendorId) (BSTR *aVendorId)
    537 {
    538     return usbFilterFieldGetter(USBFILTERIDX_VENDOR_ID, aVendorId);
    539 }
    540 
    541 STDMETHODIMP USBDeviceFilter::COMSETTER(VendorId) (IN_BSTR aVendorId)
    542 {
    543     return usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, aVendorId);
    544 }
    545 
    546 STDMETHODIMP USBDeviceFilter::COMGETTER(ProductId) (BSTR *aProductId)
    547 {
    548     return usbFilterFieldGetter(USBFILTERIDX_PRODUCT_ID, aProductId);
    549 }
    550 
    551 STDMETHODIMP USBDeviceFilter::COMSETTER(ProductId) (IN_BSTR aProductId)
    552 {
    553     return usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, aProductId);
    554  }
    555 
    556 STDMETHODIMP USBDeviceFilter::COMGETTER(Revision) (BSTR *aRevision)
    557 {
    558     return usbFilterFieldGetter(USBFILTERIDX_DEVICE, aRevision);
    559 }
    560 
    561 STDMETHODIMP USBDeviceFilter::COMSETTER(Revision) (IN_BSTR aRevision)
    562 {
    563     return usbFilterFieldSetter(USBFILTERIDX_DEVICE, aRevision);
    564 }
    565 
    566 STDMETHODIMP USBDeviceFilter::COMGETTER(Manufacturer) (BSTR *aManufacturer)
    567 {
    568     return usbFilterFieldGetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
    569 }
    570 
    571 STDMETHODIMP USBDeviceFilter::COMSETTER(Manufacturer) (IN_BSTR aManufacturer)
    572 {
    573     return usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
    574 }
    575 
    576 STDMETHODIMP USBDeviceFilter::COMGETTER(Product) (BSTR *aProduct)
    577 {
    578     return usbFilterFieldGetter(USBFILTERIDX_PRODUCT_STR, aProduct);
    579 }
    580 
    581 STDMETHODIMP USBDeviceFilter::COMSETTER(Product) (IN_BSTR aProduct)
    582 {
    583     return usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, aProduct);
    584 }
    585 
    586 STDMETHODIMP USBDeviceFilter::COMGETTER(SerialNumber) (BSTR *aSerialNumber)
    587 {
    588     return usbFilterFieldGetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
    589 }
    590 
    591 STDMETHODIMP USBDeviceFilter::COMSETTER(SerialNumber) (IN_BSTR aSerialNumber)
    592 {
    593     return usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
    594 }
    595 
    596 STDMETHODIMP USBDeviceFilter::COMGETTER(Port) (BSTR *aPort)
    597 {
    598     return usbFilterFieldGetter(USBFILTERIDX_PORT, aPort);
    599 }
    600 
    601 STDMETHODIMP USBDeviceFilter::COMSETTER(Port) (IN_BSTR aPort)
    602 {
    603     return usbFilterFieldSetter(USBFILTERIDX_PORT, aPort);
    604 }
    605 
    606 STDMETHODIMP USBDeviceFilter::COMGETTER(Remote) (BSTR *aRemote)
    607 {
    608     CheckComArgOutPointerValid(aRemote);
    609 
    610     AutoCaller autoCaller(this);
    611     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    612 
     511        return mParent->i_onDeviceFilterChange(this, TRUE /* aActiveChanged */);
     512    }
     513
     514    return S_OK;
     515}
     516
     517HRESULT USBDeviceFilter::getVendorId(com::Utf8Str &aVendorId)
     518{
     519    return i_usbFilterFieldGetter(USBFILTERIDX_VENDOR_ID, aVendorId);
     520}
     521
     522HRESULT USBDeviceFilter::setVendorId(const com::Utf8Str &aVendorId)
     523{
     524    return i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, Bstr(aVendorId).raw());
     525}
     526
     527HRESULT USBDeviceFilter::getProductId(com::Utf8Str &aProductId)
     528{
     529    return i_usbFilterFieldGetter(USBFILTERIDX_PRODUCT_ID, aProductId);
     530}
     531
     532HRESULT USBDeviceFilter::setProductId(const com::Utf8Str &aProductId)
     533{
     534    return i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, aProductId);
     535}
     536
     537HRESULT USBDeviceFilter::getRevision(com::Utf8Str &aRevision)
     538{
     539    return i_usbFilterFieldGetter(USBFILTERIDX_DEVICE, aRevision);
     540}
     541
     542HRESULT USBDeviceFilter::setRevision(const com::Utf8Str &aRevision)
     543{
     544    return i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, Bstr(aRevision).raw());
     545}
     546
     547HRESULT USBDeviceFilter::getManufacturer(com::Utf8Str &aManufacturer)
     548{
     549    return i_usbFilterFieldGetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
     550}
     551
     552HRESULT USBDeviceFilter::setManufacturer(const com::Utf8Str &aManufacturer)
     553{
     554    return i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, Bstr(aManufacturer).raw());
     555}
     556
     557HRESULT USBDeviceFilter::getProduct(com::Utf8Str &aProduct)
     558{
     559    return i_usbFilterFieldGetter(USBFILTERIDX_PRODUCT_STR, aProduct);
     560}
     561
     562HRESULT USBDeviceFilter::setProduct(const com::Utf8Str &aProduct)
     563{
     564    return i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, Bstr(aProduct).raw());
     565}
     566
     567HRESULT USBDeviceFilter::getSerialNumber(com::Utf8Str &aSerialNumber)
     568{
     569    return i_usbFilterFieldGetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
     570}
     571
     572HRESULT USBDeviceFilter::setSerialNumber(const com::Utf8Str &aSerialNumber)
     573{
     574    return i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR,  Bstr(aSerialNumber).raw());
     575}
     576
     577HRESULT USBDeviceFilter::getPort(com::Utf8Str &aPort)
     578{
     579    return i_usbFilterFieldGetter(USBFILTERIDX_PORT, aPort);
     580}
     581
     582HRESULT USBDeviceFilter::setPort(const com::Utf8Str &aPort)
     583{
     584    return i_usbFilterFieldSetter(USBFILTERIDX_PORT, Bstr(aPort).raw());
     585}
     586
     587
     588HRESULT USBDeviceFilter::getRemote(com::Utf8Str &aRemote)
     589{
    613590    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    614591
    615     mData->mRemote.string().cloneTo(aRemote);
    616 
    617     return S_OK;
    618 }
    619 
    620 STDMETHODIMP USBDeviceFilter::COMSETTER(Remote) (IN_BSTR aRemote)
    621 {
    622     AutoCaller autoCaller(this);
    623     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    624 
     592    aRemote = mData->mRemote.string();
     593
     594    return S_OK;
     595}
     596
     597HRESULT USBDeviceFilter::setRemote(const com::Utf8Str &aRemote)
     598{
    625599    /* the machine needs to be mutable */
    626     AutoMutableStateDependency adep(mParent->getMachine());
     600    AutoMutableStateDependency adep(mParent->i_getMachine());
    627601    if (FAILED(adep.rc())) return adep.rc();
    628 
    629602    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    630 
    631     if (mData->mRemote.string() != aRemote)
    632     {
    633         Data::BOOLFilter flt = aRemote;
     603    Bstr bRemote = Bstr(aRemote).raw();
     604
     605    if (mData->mRemote.string() != bRemote)
     606    {
     607        Data::BOOLFilter flt = bRemote;
    634608        ComAssertRet(!flt.isNull(), E_FAIL);
    635609        if (!flt.isValid())
    636610            return setError(E_INVALIDARG,
    637611                            tr("Remote state filter string '%ls' is not valid (error at position %d)"),
    638                             aRemote, flt.errorPosition() + 1);
     612                            bRemote.raw(), flt.errorPosition() + 1);
    639613
    640614        m_fModified = true;
    641         ComObjPtr<Machine> pMachine = mParent->getMachine();
     615        ComObjPtr<Machine> pMachine = mParent->i_getMachine();
    642616
    643617        mData.backup();
     
    651625        mlock.release();
    652626
    653         return mParent->onDeviceFilterChange(this);
    654     }
    655 
    656     return S_OK;
    657 }
    658 
    659 STDMETHODIMP USBDeviceFilter::COMGETTER(MaskedInterfaces) (ULONG *aMaskedIfs)
    660 {
    661     CheckComArgOutPointerValid(aMaskedIfs);
    662 
    663     AutoCaller autoCaller(this);
    664     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    665 
     627        return mParent->i_onDeviceFilterChange(this);
     628    }
     629    return S_OK;
     630}
     631
     632
     633HRESULT USBDeviceFilter::getMaskedInterfaces(ULONG *aMaskedIfs)
     634{
    666635    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    667636
     
    671640}
    672641
    673 STDMETHODIMP USBDeviceFilter::COMSETTER(MaskedInterfaces) (ULONG aMaskedIfs)
    674 {
    675     AutoCaller autoCaller(this);
    676     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    677 
     642HRESULT USBDeviceFilter::setMaskedInterfaces(ULONG aMaskedIfs)
     643{
    678644    /* the machine needs to be mutable */
    679     AutoMutableStateDependency adep(mParent->getMachine());
     645    AutoMutableStateDependency adep(mParent->i_getMachine());
    680646    if (FAILED(adep.rc())) return adep.rc();
    681647
     
    685651    {
    686652        m_fModified = true;
    687         ComObjPtr<Machine> pMachine = mParent->getMachine();
     653        ComObjPtr<Machine> pMachine = mParent->i_getMachine();
    688654
    689655        mData.backup();
    690656        mData->mMaskedIfs = aMaskedIfs;
    691 
    692657        // leave the lock before informing callbacks
    693658        alock.release();
     
    697662        mlock.release();
    698663
    699         return mParent->onDeviceFilterChange(this);
     664        return mParent->i_onDeviceFilterChange(this);
    700665    }
    701666
     
    706671////////////////////////////////////////////////////////////////////////////////
    707672
    708 bool USBDeviceFilter::isModified()
     673bool USBDeviceFilter::i_isModified()
    709674{
    710675    AutoCaller autoCaller(this);
     
    718683 *  @note Locks this object for writing.
    719684 */
    720 void USBDeviceFilter::rollback()
     685void USBDeviceFilter::i_rollback()
    721686{
    722687    /* sanity */
     
    733698 *  for writing) if there is one.
    734699 */
    735 void USBDeviceFilter::commit()
     700void USBDeviceFilter::i_commit()
    736701{
    737702    /* sanity */
     
    799764 *  @return COM status.
    800765 */
    801 HRESULT USBDeviceFilter::usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr)
    802 {
    803     CheckComArgOutPointerValid(aStr);
    804 
    805     AutoCaller autoCaller(this);
    806     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    807 
     766HRESULT USBDeviceFilter::i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr)
     767{
    808768    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    809769
    810     Utf8Str str;
    811     usbFilterFieldToString(&mData->mUSBFilter, aIdx, str);
    812 
    813     str.cloneTo(aStr);
    814 
     770    i_usbFilterFieldToString(&mData->mUSBFilter, aIdx, aStr);
    815771    return S_OK;
    816772}
     
    824780 *  @return COM status.
    825781 */
    826 HRESULT USBDeviceFilter::usbFilterFieldSetter(USBFILTERIDX aIdx,
    827                                               const Utf8Str &strNew)
    828 {
    829     AutoCaller autoCaller(this);
    830     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    831 
     782HRESULT USBDeviceFilter::i_usbFilterFieldSetter(USBFILTERIDX aIdx,
     783                                                const com::Utf8Str &strNew)
     784{
    832785    /* the machine needs to be mutable */
    833     AutoMutableStateDependency adep(mParent->getMachine());
     786    AutoMutableStateDependency adep(mParent->i_getMachine());
    834787    if (FAILED(adep.rc())) return adep.rc();
    835788
    836789    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    837790
    838     Utf8Str strOld;
    839     usbFilterFieldToString(&mData->mUSBFilter, aIdx, strOld);
     791
     792    com::Utf8Str strOld;
     793    i_usbFilterFieldToString(&mData->mUSBFilter, aIdx, strOld);
    840794    if (strOld != strNew)
    841795    {
    842796        m_fModified = true;
    843         ComObjPtr<Machine> pMachine = mParent->getMachine();
     797        ComObjPtr<Machine> pMachine = mParent->i_getMachine();
    844798
    845799        mData.backup();
    846800
    847         Utf8Str errStr;
    848         HRESULT rc = usbFilterFieldFromString(&mData->mUSBFilter, aIdx, strNew, errStr);
     801        com::Utf8Str errStr;
     802        HRESULT rc = i_usbFilterFieldFromString(&mData->mUSBFilter, aIdx, strNew, errStr);
    849803        if (FAILED(rc))
    850804        {
     
    860814        mlock.release();
    861815
    862         return mParent->onDeviceFilterChange(this);
    863     }
    864 
    865     return S_OK;
    866 }
    867 
    868 /**
    869  *  Generic USB filter field setter, expects UTF-16 input.
    870  *
    871  *  @param  aIdx    The field index.
    872  *  @param  aStr    The new value.
    873  *
    874  *  @return COM status.
    875  */
    876 HRESULT USBDeviceFilter::usbFilterFieldSetter(USBFILTERIDX aIdx,
    877                                               IN_BSTR aStr)
    878 {
    879     return usbFilterFieldSetter(aIdx, Utf8Str(aStr));
     816        return mParent->i_onDeviceFilterChange(this);
     817    }
     818
     819    return S_OK;
    880820}
    881821
     
    948888    do
    949889    {
    950         rc = COMSETTER(Action)(data.action);
    951         if (FAILED(rc)) break;
    952 
    953         rc = usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId);
    954         if (FAILED(rc)) break;
    955 
    956         rc = usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId);
    957         if (FAILED(rc)) break;
    958 
    959         rc = usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision);
    960         if (FAILED(rc)) break;
    961 
    962         rc = usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
    963         if (FAILED(rc)) break;
    964 
    965         rc = usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProduct);
    966         if (FAILED(rc)) break;
    967 
    968         rc = usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
    969         if (FAILED(rc)) break;
    970 
    971         rc = usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort);
     890        rc = setAction(data.action);
     891        if (FAILED(rc)) break;
     892
     893        rc = i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, data.strVendorId);
     894        if (FAILED(rc)) break;
     895
     896        rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProductId);
     897        if (FAILED(rc)) break;
     898
     899        rc = i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, data.strRevision);
     900        if (FAILED(rc)) break;
     901
     902        rc = i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
     903        if (FAILED(rc)) break;
     904
     905        rc = i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, data.strProduct);
     906        if (FAILED(rc)) break;
     907
     908        rc = i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
     909        if (FAILED(rc)) break;
     910
     911        rc = i_usbFilterFieldSetter(USBFILTERIDX_PORT, data.strPort);
    972912        if (FAILED(rc)) break;
    973913    }
     
    1044984 * to be our parent.
    1045985 */
    1046 RWLockHandle *HostUSBDeviceFilter::lockHandle() const
     986RWLockHandle *HostUSBDeviceFilter::i_lockHandle() const
    1047987{
    1048988    return mParent->lockHandle();
     
    1052992// IUSBDeviceFilter properties
    1053993////////////////////////////////////////////////////////////////////////////////
    1054 
    1055 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Name) (BSTR *aName)
    1056 {
    1057     CheckComArgOutPointerValid(aName);
    1058 
    1059     AutoCaller autoCaller(this);
    1060     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1061 
     994HRESULT HostUSBDeviceFilter::getName(com::Utf8Str &aName)
     995{
    1062996    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1063997
    1064     mData->mName.cloneTo(aName);
    1065 
    1066     return S_OK;
    1067 }
    1068 
    1069 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Name) (IN_BSTR aName)
    1070 {
    1071     CheckComArgStrNotEmptyOrNull(aName);
    1072 
    1073     AutoCaller autoCaller(this);
    1074     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1075 
     998    aName = mData->mName;
     999
     1000    return S_OK;
     1001}
     1002
     1003
     1004HRESULT HostUSBDeviceFilter::setName(const com::Utf8Str &aName)
     1005{
    10761006    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    10771007
     
    10891019}
    10901020
    1091 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Active) (BOOL *aActive)
    1092 {
    1093     CheckComArgOutPointerValid(aActive);
    1094 
    1095     AutoCaller autoCaller(this);
    1096     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1097 
     1021
     1022HRESULT HostUSBDeviceFilter::getActive(BOOL *aActive)
     1023{
    10981024    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    10991025
     
    11031029}
    11041030
    1105 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Active) (BOOL aActive)
    1106 {
    1107     AutoCaller autoCaller(this);
    1108     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1109 
     1031
     1032HRESULT HostUSBDeviceFilter::setActive(BOOL aActive)
     1033{
    11101034    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    11111035
     
    11231047}
    11241048
    1125 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(VendorId) (BSTR *aVendorId)
    1126 {
    1127     return usbFilterFieldGetter(USBFILTERIDX_VENDOR_ID, aVendorId);
    1128 }
    1129 
    1130 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(VendorId) (IN_BSTR aVendorId)
    1131 {
    1132     return usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, aVendorId);
    1133 }
    1134 
    1135 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(ProductId) (BSTR *aProductId)
    1136 {
    1137     return usbFilterFieldGetter(USBFILTERIDX_PRODUCT_ID, aProductId);
    1138 }
    1139 
    1140 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(ProductId) (IN_BSTR aProductId)
    1141 {
    1142     return usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, aProductId);
    1143 }
    1144 
    1145 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Revision) (BSTR *aRevision)
    1146 {
    1147     return usbFilterFieldGetter(USBFILTERIDX_DEVICE, aRevision);
    1148 }
    1149 
    1150 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Revision) (IN_BSTR aRevision)
    1151 {
    1152     return usbFilterFieldSetter(USBFILTERIDX_DEVICE, aRevision);
    1153 }
    1154 
    1155 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Manufacturer) (BSTR *aManufacturer)
    1156 {
    1157     return usbFilterFieldGetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
    1158 }
    1159 
    1160 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Manufacturer) (IN_BSTR aManufacturer)
    1161 {
    1162     return usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
    1163 }
    1164 
    1165 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Product) (BSTR *aProduct)
    1166 {
    1167     return usbFilterFieldGetter(USBFILTERIDX_PRODUCT_STR, aProduct);
    1168 }
    1169 
    1170 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Product) (IN_BSTR aProduct)
    1171 {
    1172     return usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, aProduct);
    1173 }
    1174 
    1175 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(SerialNumber) (BSTR *aSerialNumber)
    1176 {
    1177     return usbFilterFieldGetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
    1178 }
    1179 
    1180 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(SerialNumber) (IN_BSTR aSerialNumber)
    1181 {
    1182     return usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
    1183 }
    1184 
    1185 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Port) (BSTR *aPort)
    1186 {
    1187     return usbFilterFieldGetter(USBFILTERIDX_PORT, aPort);
    1188 }
    1189 
    1190 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Port) (IN_BSTR aPort)
    1191 {
    1192     return usbFilterFieldSetter(USBFILTERIDX_PORT, aPort);
    1193 }
    1194 
    1195 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Remote) (BSTR *aRemote)
    1196 {
    1197     CheckComArgOutPointerValid(aRemote);
    1198 
    1199     AutoCaller autoCaller(this);
    1200     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1201 
     1049HRESULT HostUSBDeviceFilter::getVendorId(com::Utf8Str &aVendorId)
     1050{
     1051    return i_usbFilterFieldGetter(USBFILTERIDX_VENDOR_ID, aVendorId);
     1052}
     1053
     1054HRESULT HostUSBDeviceFilter::setVendorId(const com::Utf8Str &aVendorId)
     1055{
     1056    return i_usbFilterFieldSetter(USBFILTERIDX_VENDOR_ID, aVendorId);
     1057}
     1058
     1059HRESULT HostUSBDeviceFilter::getProductId(com::Utf8Str &aProductId)
     1060{
     1061    return i_usbFilterFieldGetter(USBFILTERIDX_PRODUCT_ID, aProductId);
     1062}
     1063
     1064HRESULT HostUSBDeviceFilter::setProductId(const com::Utf8Str &aProductId)
     1065{
     1066    return i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_ID, aProductId);
     1067}
     1068
     1069HRESULT HostUSBDeviceFilter::getRevision(com::Utf8Str &aRevision)
     1070{
     1071    return i_usbFilterFieldGetter(USBFILTERIDX_DEVICE, aRevision);
     1072}
     1073
     1074HRESULT HostUSBDeviceFilter::setRevision(const com::Utf8Str &aRevision)
     1075{
     1076    return i_usbFilterFieldSetter(USBFILTERIDX_DEVICE, aRevision);
     1077}
     1078
     1079HRESULT HostUSBDeviceFilter::getManufacturer(com::Utf8Str &aManufacturer)
     1080{
     1081    return i_usbFilterFieldGetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
     1082}
     1083
     1084HRESULT HostUSBDeviceFilter::setManufacturer(const com::Utf8Str &aManufacturer)
     1085{
     1086    return i_usbFilterFieldSetter(USBFILTERIDX_MANUFACTURER_STR, aManufacturer);
     1087}
     1088
     1089HRESULT HostUSBDeviceFilter::getProduct(com::Utf8Str &aProduct)
     1090{
     1091    return i_usbFilterFieldGetter(USBFILTERIDX_PRODUCT_STR, aProduct);
     1092}
     1093
     1094HRESULT HostUSBDeviceFilter::setProduct(const com::Utf8Str &aProduct)
     1095{
     1096    return i_usbFilterFieldSetter(USBFILTERIDX_PRODUCT_STR, aProduct);
     1097}
     1098
     1099HRESULT HostUSBDeviceFilter::getSerialNumber(com::Utf8Str &aSerialNumber)
     1100{
     1101    return i_usbFilterFieldGetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
     1102}
     1103
     1104HRESULT HostUSBDeviceFilter::setSerialNumber(const com::Utf8Str &aSerialNumber)
     1105{
     1106    return i_usbFilterFieldSetter(USBFILTERIDX_SERIAL_NUMBER_STR, aSerialNumber);
     1107}
     1108
     1109HRESULT HostUSBDeviceFilter::getPort(com::Utf8Str &aPort)
     1110{
     1111    return i_usbFilterFieldGetter(USBFILTERIDX_PORT, aPort);
     1112}
     1113
     1114HRESULT HostUSBDeviceFilter::setPort(const com::Utf8Str &aPort)
     1115{
     1116    return i_usbFilterFieldSetter(USBFILTERIDX_PORT, aPort);
     1117}
     1118
     1119HRESULT HostUSBDeviceFilter::getRemote(com::Utf8Str &aRemote)
     1120{
    12021121    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12031122
    1204     mData->mRemote.string().cloneTo(aRemote);
    1205 
    1206     return S_OK;
    1207 }
    1208 
    1209 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Remote) (IN_BSTR /* aRemote */)
     1123    aRemote = mData->mRemote.string();
     1124
     1125    return S_OK;
     1126}
     1127
     1128HRESULT HostUSBDeviceFilter::setRemote(const com::Utf8Str & /* aRemote */)
    12101129{
    12111130    return setError(E_NOTIMPL,
     
    12131132}
    12141133
    1215 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(MaskedInterfaces) (ULONG *aMaskedIfs)
    1216 {
    1217     CheckComArgOutPointerValid(aMaskedIfs);
    1218 
    1219     AutoCaller autoCaller(this);
    1220     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1221 
     1134
     1135HRESULT HostUSBDeviceFilter::getMaskedInterfaces(ULONG *aMaskedIfs)
     1136{
    12221137    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    12231138
     
    12261141    return S_OK;
    12271142}
    1228 
    1229 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(MaskedInterfaces) (ULONG /* aMaskedIfs */)
     1143HRESULT HostUSBDeviceFilter::setMaskedInterfaces(ULONG /* aMaskedIfs */)
    12301144{
    12311145    return setError(E_NOTIMPL,
     
    12331147}
    12341148
    1235 // IHostUSBDeviceFilter properties
    1236 ////////////////////////////////////////////////////////////////////////////////
    1237 
    1238 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(Action) (USBDeviceFilterAction_T *aAction)
     1149// wrapped IHostUSBDeviceFilter properties
     1150////////////////////////////////////////////////////////////////////////////////
     1151HRESULT HostUSBDeviceFilter::getAction(USBDeviceFilterAction_T *aAction)
    12391152{
    12401153    CheckComArgOutPointerValid(aAction);
    1241 
    1242     AutoCaller autoCaller(this);
    1243     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    12441154
    12451155    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    12551165}
    12561166
    1257 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(Action) (USBDeviceFilterAction_T aAction)
    1258 {
    1259     AutoCaller autoCaller(this);
    1260     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1261 
     1167
     1168HRESULT HostUSBDeviceFilter::setAction(USBDeviceFilterAction_T aAction)
     1169{
    12621170    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    12631171
     
    12921200}
    12931201
     1202
     1203// IHostUSBDeviceFilter properties
     1204////////////////////////////////////////////////////////////////////////////////
    12941205/**
    12951206 *  Generic USB filter field getter.
     
    13001211 *  @return COM status.
    13011212 */
    1302 HRESULT HostUSBDeviceFilter::usbFilterFieldGetter(USBFILTERIDX aIdx, BSTR *aStr)
    1303 {
    1304     CheckComArgOutPointerValid(aStr);
    1305 
    1306     AutoCaller autoCaller(this);
    1307     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1308 
     1213HRESULT HostUSBDeviceFilter::i_usbFilterFieldGetter(USBFILTERIDX aIdx, com::Utf8Str &aStr)
     1214{
    13091215    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1310 
    1311     Utf8Str str;
    1312     usbFilterFieldToString(&mData->mUSBFilter, aIdx, str);
    1313 
    1314     str.cloneTo(aStr);
    1315 
    1316     return S_OK;
    1317 }
    1318 
    1319 void HostUSBDeviceFilter::saveSettings(settings::USBDeviceFilter &data)
     1216    i_usbFilterFieldToString(&mData->mUSBFilter, aIdx, aStr);
     1217    return S_OK;
     1218}
     1219
     1220void HostUSBDeviceFilter::i_saveSettings(settings::USBDeviceFilter &data)
    13201221{
    13211222    AutoCaller autoCaller(this);
     
    13231224
    13241225    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1325 
    13261226    data.strName = mData->mName;
    13271227    data.fActive = !!mData->mActive;
    1328 
    1329     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_VENDOR_ID, data.strVendorId);
    1330     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PRODUCT_ID, data.strProductId);
    1331     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_DEVICE, data.strRevision);
    1332     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
    1333     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PRODUCT_STR, data.strProduct);
    1334     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
    1335     usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PORT, data.strPort);
     1228    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_VENDOR_ID, data.strVendorId);
     1229    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PRODUCT_ID, data.strProductId);
     1230    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_DEVICE, data.strRevision);
     1231    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_MANUFACTURER_STR, data.strManufacturer);
     1232    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PRODUCT_STR, data.strProduct);
     1233    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_SERIAL_NUMBER_STR, data.strSerialNumber);
     1234    i_usbFilterFieldToString(&mData->mUSBFilter, USBFILTERIDX_PORT, data.strPort);
    13361235
    13371236    COMGETTER(Action)(&data.action);
     
    13481247 *  @return COM status.
    13491248 */
    1350 HRESULT HostUSBDeviceFilter::usbFilterFieldSetter(USBFILTERIDX aIdx, Bstr aStr)
    1351 {
    1352     AutoCaller autoCaller(this);
    1353     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    1354 
     1249HRESULT HostUSBDeviceFilter::i_usbFilterFieldSetter(USBFILTERIDX aIdx, const com::Utf8Str &aStr)
     1250{
    13551251    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1356 
    13571252    Utf8Str strOld;
    1358     Utf8Str strNew(aStr);
    1359     usbFilterFieldToString(&mData->mUSBFilter, aIdx, strOld);
    1360     if (strOld != strNew)
     1253    i_usbFilterFieldToString(&mData->mUSBFilter, aIdx, strOld);
     1254    if (strOld != aStr)
    13611255    {
    13621256        //mData.backup();
    1363 
    1364         Utf8Str errStr;
    1365         HRESULT rc = USBDeviceFilter::usbFilterFieldFromString(&mData->mUSBFilter, aIdx, aStr, errStr);
     1257        com::Utf8Str errStr;
     1258        HRESULT rc = USBDeviceFilter::i_usbFilterFieldFromString(&mData->mUSBFilter, aIdx, aStr, errStr);
    13661259        if (FAILED(rc))
    13671260        {
  • trunk/src/VBox/Main/src-server/USBDeviceFiltersImpl.cpp

    r49742 r49951  
    290290
    291291
    292 STDMETHODIMP USBDeviceFilters::COMGETTER(DeviceFilters)(ComSafeArrayOut(IUSBDeviceFilter *, aDevicesFilters))
    293 {
    294 #ifdef VBOX_WITH_USB
    295     CheckComArgOutSafeArrayPointerValid(aDevicesFilters);
    296 
    297     AutoCaller autoCaller(this);
    298     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    299 
     292HRESULT USBDeviceFilters::getDeviceFilters(std::vector<ComPtr<IUSBDeviceFilter> > &aDeviceFilters)
     293{
     294#ifdef VBOX_WITH_USB
    300295    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    301296
    302297    SafeIfaceArray<IUSBDeviceFilter> collection(*m->llDeviceFilters.data());
    303     collection.detachTo(ComSafeArrayOutArg(aDevicesFilters));
     298    aDeviceFilters.resize(collection.size());
     299    if (collection.size())
     300        for (size_t i = 0; i < collection.size(); ++i)
     301            aDeviceFilters[i] = collection[i];
    304302
    305303    return S_OK;
    306304#else
    307     NOREF(aDevicesFilters);
     305    NOREF(aDeviceFilters);
    308306# ifndef RT_OS_WINDOWS
    309     NOREF(aDevicesFiltersSize);
     307    NOREF(aDeviceFilters);
    310308# endif
    311309    ReturnComNotImplemented();
     
    313311}
    314312
    315 // IUSBDeviceFilters methods
     313// wrapped IUSBDeviceFilters methods
    316314/////////////////////////////////////////////////////////////////////////////
    317315
    318 STDMETHODIMP USBDeviceFilters::CreateDeviceFilter(IN_BSTR aName,
    319                                                   IUSBDeviceFilter **aFilter)
    320 {
    321 #ifdef VBOX_WITH_USB
    322     CheckComArgOutPointerValid(aFilter);
    323 
    324     CheckComArgStrNotEmptyOrNull(aName);
    325 
    326     AutoCaller autoCaller(this);
    327     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     316HRESULT USBDeviceFilters::createDeviceFilter(const com::Utf8Str &aName,
     317                                             ComPtr<IUSBDeviceFilter> &aFilter)
     318
     319{
     320#ifdef VBOX_WITH_USB
    328321
    329322    /* the machine needs to be mutable */
     
    335328    ComObjPtr<USBDeviceFilter> pFilter;
    336329    pFilter.createObject();
    337     HRESULT rc = pFilter->init(this, aName);
     330    HRESULT rc = pFilter->init(this, Bstr(aName).raw());
    338331    ComAssertComRCRetRC(rc);
    339     rc = pFilter.queryInterfaceTo(aFilter);
     332    rc = pFilter.queryInterfaceTo(aFilter.asOutParam());
    340333    AssertComRCReturnRC(rc);
    341334
     
    348341}
    349342
    350 STDMETHODIMP USBDeviceFilters::InsertDeviceFilter(ULONG aPosition,
    351                                                   IUSBDeviceFilter *aFilter)
    352 {
    353 #ifdef VBOX_WITH_USB
    354 
    355     CheckComArgNotNull(aFilter);
    356 
    357     AutoCaller autoCaller(this);
    358     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     343
     344HRESULT USBDeviceFilters::insertDeviceFilter(ULONG aPosition,
     345                                             const ComPtr<IUSBDeviceFilter> &aFilter)
     346{
     347#ifdef VBOX_WITH_USB
    359348
    360349    /* the machine needs to be mutable */
     
    364353    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    365354
    366     ComObjPtr<USBDeviceFilter> pFilter = static_cast<USBDeviceFilter*>(aFilter);
     355    IUSBDeviceFilter *iFilter = aFilter;
     356    ComObjPtr<USBDeviceFilter> pFilter = static_cast<USBDeviceFilter*>(iFilter);
    367357
    368358    if (pFilter->mInList)
     
    387377
    388378    /* notify the proxy (only when it makes sense) */
    389     if (pFilter->getData().mActive && Global::IsOnline(adep.machineState())
    390         && pFilter->getData().mRemote.isMatch(false))
     379    if (pFilter->i_getData().mActive && Global::IsOnline(adep.machineState())
     380        && pFilter->i_getData().mRemote.isMatch(false))
    391381    {
    392382        USBProxyService *pProxySvc = m->pHost->i_usbProxyService();
    393383        ComAssertRet(pProxySvc, E_FAIL);
    394384
    395         ComAssertRet(pFilter->getId() == NULL, E_FAIL);
    396         pFilter->getId() = pProxySvc->insertFilter(&pFilter->getData().mUSBFilter);
     385        ComAssertRet(pFilter->i_getId() == NULL, E_FAIL);
     386        pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
    397387    }
    398388
     
    413403}
    414404
    415 STDMETHODIMP USBDeviceFilters::RemoveDeviceFilter(ULONG aPosition,
    416                                                   IUSBDeviceFilter **aFilter)
    417 {
    418 #ifdef VBOX_WITH_USB
    419 
    420     CheckComArgOutPointerValid(aFilter);
    421 
    422     AutoCaller autoCaller(this);
    423     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    424 
     405HRESULT USBDeviceFilters::removeDeviceFilter(ULONG aPosition,
     406                                             ComPtr<IUSBDeviceFilter> &aFilter)
     407{
     408#ifdef VBOX_WITH_USB
    425409    /* the machine needs to be mutable */
    426410    AutoMutableStateDependency adep(m->pParent);
     
    455439    /* cancel sharing (make an independent copy of data) */
    456440    pFilter->unshare();
    457 
    458     pFilter.queryInterfaceTo(aFilter);
     441    pFilter.queryInterfaceTo(aFilter.asOutParam());
     442
    459443
    460444    /* notify the proxy (only when it makes sense) */
    461     if (pFilter->getData().mActive && Global::IsOnline(adep.machineState())
    462         && pFilter->getData().mRemote.isMatch(false))
     445    if (pFilter->i_getData().mActive && Global::IsOnline(adep.machineState())
     446        && pFilter->i_getData().mRemote.isMatch(false))
    463447    {
    464448        USBProxyService *pProxySvc = m->pHost->i_usbProxyService();
    465449        ComAssertRet(pProxySvc, E_FAIL);
    466450
    467         ComAssertRet(pFilter->getId() != NULL, E_FAIL);
    468         pProxySvc->removeFilter(pFilter->getId());
    469         pFilter->getId() = NULL;
     451        ComAssertRet(pFilter->i_getId() != NULL, E_FAIL);
     452        pProxySvc->removeFilter(pFilter->i_getId());
     453        pFilter->i_getId() = NULL;
    470454    }
    471455
     
    497481 *  @note Does not lock "this" as Machine::loadHardware, which calls this, does not lock either.
    498482 */
    499 HRESULT USBDeviceFilters::loadSettings(const settings::USB &data)
     483HRESULT USBDeviceFilters::i_loadSettings(const settings::USB &data)
    500484{
    501485    AutoCaller autoCaller(this);
     
    540524 *  @note Locks this object for reading.
    541525 */
    542 HRESULT USBDeviceFilters::saveSettings(settings::USB &data)
     526HRESULT USBDeviceFilters::i_saveSettings(settings::USB &data)
    543527{
    544528    AutoCaller autoCaller(this);
     
    555539    {
    556540        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    557         const USBDeviceFilter::Data &filterData = (*it)->getData();
     541        const USBDeviceFilter::Data &filterData = (*it)->i_getData();
    558542
    559543        Bstr str;
     
    587571
    588572/** @note Locks objects for writing! */
    589 void USBDeviceFilters::rollback()
     573void USBDeviceFilters::i_rollback()
    590574{
    591575    AutoCaller autoCaller(this);
     
    614598            {
    615599                /* notify the proxy (only when it makes sense) */
    616                 if ((*it)->getData().mActive &&
     600                if ((*it)->i_getData().mActive &&
    617601                    Global::IsOnline(adep.machineState())
    618                     && (*it)->getData().mRemote.isMatch(false))
     602                    && (*it)->i_getData().mRemote.isMatch(false))
    619603                {
    620604                    USBDeviceFilter *pFilter = *it;
    621                     Assert(pFilter->getId() != NULL);
    622                     pProxySvc->removeFilter(pFilter->getId());
    623                     pFilter->getId() = NULL;
     605                    Assert(pFilter->i_getId() != NULL);
     606                    pProxySvc->removeFilter(pFilter->i_getId());
     607                    pFilter->i_getId() = NULL;
    624608                }
    625609
     
    640624                {
    641625                    /* notify the proxy (only when necessary) */
    642                     if ((*it)->getData().mActive
    643                             && (*it)->getData().mRemote.isMatch(false))
     626                    if ((*it)->i_getData().mActive
     627                            && (*it)->i_getData().mRemote.isMatch(false))
    644628                    {
    645629                        USBDeviceFilter *pFilter = *it; /* resolve ambiguity */
    646                         Assert(pFilter->getId() == NULL);
    647                         pFilter->getId() = pProxySvc->insertFilter(&pFilter->getData().mUSBFilter);
     630                        Assert(pFilter->i_getId() == NULL);
     631                        pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
    648632                    }
    649633                }
     
    663647    while (it != m->llDeviceFilters->end())
    664648    {
    665         if ((*it)->isModified())
     649        if ((*it)->i_isModified())
    666650        {
    667             (*it)->rollback();
     651            (*it)->i_rollback();
    668652            /* call this to notify the USB proxy about changes */
    669             onDeviceFilterChange(*it);
     653            i_onDeviceFilterChange(*it);
    670654        }
    671655        ++it;
     
    679663 *  for writing) if there is one.
    680664 */
    681 void USBDeviceFilters::commit()
     665void USBDeviceFilters::i_commit()
    682666{
    683667    /* sanity */
     
    711695            while (it != m->llDeviceFilters->end())
    712696            {
    713                 (*it)->commit();
     697                (*it)->i_commit();
    714698
    715699                /* look if this filter has a peer filter */
    716                 ComObjPtr<USBDeviceFilter> peer = (*it)->peer();
     700                ComObjPtr<USBDeviceFilter> peer = (*it)->i_peer();
    717701                if (!peer)
    718702                {
     
    763747        while (it != m->llDeviceFilters->end())
    764748        {
    765             (*it)->commit();
     749            (*it)->i_commit();
    766750            ++it;
    767751        }
     
    774758 *  represented by @a aThat (locked for reading).
    775759 */
    776 void USBDeviceFilters::copyFrom(USBDeviceFilters *aThat)
     760void USBDeviceFilters::i_copyFrom(USBDeviceFilters *aThat)
    777761{
    778762    AssertReturnVoid(aThat != NULL);
     
    825809 *  @note Locks nothing.
    826810 */
    827 HRESULT USBDeviceFilters::onDeviceFilterChange(USBDeviceFilter *aFilter,
    828                                                BOOL aActiveChanged /* = FALSE */)
     811HRESULT USBDeviceFilters::i_onDeviceFilterChange(USBDeviceFilter *aFilter,
     812                                                 BOOL aActiveChanged /* = FALSE */)
    829813{
    830814    AutoCaller autoCaller(this);
     
    849833        if (aActiveChanged)
    850834        {
    851             if (aFilter->getData().mRemote.isMatch(false))
     835            if (aFilter->i_getData().mRemote.isMatch(false))
    852836            {
    853837                /* insert/remove the filter from the proxy */
    854                 if (aFilter->getData().mActive)
     838                if (aFilter->i_getData().mActive)
    855839                {
    856                     ComAssertRet(aFilter->getId() == NULL, E_FAIL);
    857                     aFilter->getId() = pProxySvc->insertFilter(&aFilter->getData().mUSBFilter);
     840                    ComAssertRet(aFilter->i_getId() == NULL, E_FAIL);
     841                    aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
    858842                }
    859843                else
    860844                {
    861                     ComAssertRet(aFilter->getId() != NULL, E_FAIL);
    862                     pProxySvc->removeFilter(aFilter->getId());
    863                     aFilter->getId() = NULL;
     845                    ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
     846                    pProxySvc->removeFilter(aFilter->i_getId());
     847                    aFilter->i_getId() = NULL;
    864848                }
    865849            }
     
    867851        else
    868852        {
    869             if (aFilter->getData().mActive)
     853            if (aFilter->i_getData().mActive)
    870854            {
    871855                /* update the filter in the proxy */
    872                 ComAssertRet(aFilter->getId() != NULL, E_FAIL);
    873                 pProxySvc->removeFilter(aFilter->getId());
    874                 if (aFilter->getData().mRemote.isMatch(false))
     856                ComAssertRet(aFilter->i_getId() != NULL, E_FAIL);
     857                pProxySvc->removeFilter(aFilter->i_getId());
     858                if (aFilter->i_getData().mRemote.isMatch(false))
    875859                {
    876                     aFilter->getId() = pProxySvc->insertFilter(&aFilter->getData().mUSBFilter);
     860                    aFilter->i_getId() = pProxySvc->insertFilter(&aFilter->i_getData().mUSBFilter);
    877861                }
    878862            }
     
    891875 *  @note Locks this object for reading.
    892876 */
    893 bool USBDeviceFilters::hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
     877bool USBDeviceFilters::i_hasMatchingFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs)
    894878{
    895879    AutoCaller autoCaller(this);
     
    908892    {
    909893        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    910         if (aDevice->isMatch((*it)->getData()))
     894        if (aDevice->isMatch((*it)->i_getData()))
    911895        {
    912             *aMaskedIfs = (*it)->getData().mMaskedIfs;
     896            *aMaskedIfs = (*it)->i_getData().mMaskedIfs;
    913897            return true;
    914898        }
     
    930914 *  @note Locks this object for reading.
    931915 */
    932 bool USBDeviceFilters::hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs)
     916bool USBDeviceFilters::i_hasMatchingFilter(IUSBDevice *aUSBDevice, ULONG *aMaskedIfs)
    933917{
    934918    LogFlowThisFuncEnter();
     
    1005989    {
    1006990        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    1007         const USBDeviceFilter::Data &aData = (*it)->getData();
     991        const USBDeviceFilter::Data &aData = (*it)->i_getData();
    1008992
    1009993        if (!aData.mActive)
     
    10331017 *  @note Locks this object for reading.
    10341018 */
    1035 HRESULT USBDeviceFilters::notifyProxy(bool aInsertFilters)
     1019HRESULT USBDeviceFilters::i_notifyProxy(bool aInsertFilters)
    10361020{
    10371021    LogFlowThisFunc(("aInsertFilters=%RTbool\n", aInsertFilters));
     
    10511035
    10521036        /* notify the proxy (only if the filter is active) */
    1053         if (   pFilter->getData().mActive
    1054             && pFilter->getData().mRemote.isMatch(false) /* and if the filter is NOT remote */
     1037        if (   pFilter->i_getData().mActive
     1038            && pFilter->i_getData().mRemote.isMatch(false) /* and if the filter is NOT remote */
    10551039           )
    10561040        {
    10571041            if (aInsertFilters)
    10581042            {
    1059                 AssertReturn(pFilter->getId() == NULL, E_FAIL);
    1060                 pFilter->getId() = pProxySvc->insertFilter(&pFilter->getData().mUSBFilter);
     1043                AssertReturn(pFilter->i_getId() == NULL, E_FAIL);
     1044                pFilter->i_getId() = pProxySvc->insertFilter(&pFilter->i_getData().mUSBFilter);
    10611045            }
    10621046            else
     
    10651049                 * when this method gets called (as a result of an early VM
    10661050                 * process crash for example. So, don't assert that ID != NULL. */
    1067                 if (pFilter->getId() != NULL)
     1051                if (pFilter->i_getId() != NULL)
    10681052                {
    1069                     pProxySvc->removeFilter(pFilter->getId());
    1070                     pFilter->getId() = NULL;
     1053                    pProxySvc->removeFilter(pFilter->i_getId());
     1054                    pFilter->i_getId() = NULL;
    10711055                }
    10721056            }
     
    10781062}
    10791063
    1080 Machine* USBDeviceFilters::getMachine()
     1064Machine* USBDeviceFilters::i_getMachine()
    10811065{
    10821066    return m->pParent;
  • trunk/src/VBox/Main/src-server/USBProxyService.cpp

    r49742 r49951  
    422422    {
    423423        AutoWriteLock filterLock(*it COMMA_LOCKVAL_SRC_POS);
    424         const HostUSBDeviceFilter::Data &data = (*it)->getData();
     424        const HostUSBDeviceFilter::Data &data = (*it)->i_getData();
    425425        if (aDevice->isMatch(data))
    426426        {
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r49795 r49951  
    442442        ComAssertComRCThrowRC(rc);
    443443
    444         rc = m->pSystemProperties->loadSettings(m->pMainConfigFile->systemProperties);
     444        rc = m->pSystemProperties->i_loadSettings(m->pMainConfigFile->systemProperties);
    445445        if (FAILED(rc)) throw rc;
    446446
     
    42684268        if (FAILED(rc)) throw rc;
    42694269
    4270         rc = m->pSystemProperties->saveSettings(m->pMainConfigFile->systemProperties);
     4270        rc = m->pSystemProperties->i_saveSettings(m->pMainConfigFile->systemProperties);
    42714271        if (FAILED(rc)) throw rc;
    42724272
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r49871 r49951  
    122122NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SharedFolder, ISharedFolder)
    123123
    124 NS_DECL_CLASSINFO(NetworkAdapter)
    125 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NetworkAdapter, INetworkAdapter)
    126 
    127 NS_DECL_CLASSINFO(USBDeviceFilters)
    128 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilters, IUSBDeviceFilters)
    129 
    130124#ifdef VBOX_WITH_USB
    131 NS_DECL_CLASSINFO(USBDeviceFilter)
    132 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilter, IUSBDeviceFilter)
    133 
    134125NS_DECL_CLASSINFO(HostUSBDevice)
    135126NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDevice, IUSBDevice, IHostUSBDevice)
    136127
    137 NS_DECL_CLASSINFO(HostUSBDeviceFilter)
    138 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDeviceFilter, IUSBDeviceFilter, IHostUSBDeviceFilter)
    139128#endif
    140 
    141 NS_DECL_CLASSINFO(SystemProperties)
    142 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SystemProperties, ISystemProperties)
    143129
    144130#ifdef VBOX_WITH_RESOURCE_USAGE_API
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r49906 r49951  
    161161# tstUSBProxyLinux
    162162#
    163 tstUSBProxyLinux_TEMPLATE  = VBOXR3TSTNPEXE
     163tstUSBProxyLinux_TEMPLATE  = VBOXMAINCLIENTTSTEXE
    164164tstUSBProxyLinux_SOURCES   = \
    165165        tstUSBProxyLinux.cpp \
     
    171171        $(VBOX_PATH_SDK)/bindings/xpcom/include \
    172172        $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
    173         $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom
     173        $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
     174        $(VBOX_MAIN_APIWRAPPER_INCS)
    174175tstUSBProxyLinux_DEFS      = \
    175176        UNIT_TEST \
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