VirtualBox

Changeset 49644 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Nov 25, 2013 4:57:15 PM (11 years ago)
Author:
vboxsync
Message:

stage 1/8 of 6813 changes

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

Legend:

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

    r42551 r49644  
    55
    66/*
    7  * Copyright (C) 2006-2012 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_BANDWIDTHCONTROLIMPL
    2020
    21 #include "VirtualBoxBase.h"
     21#include "BandwidthControlWrap.h"
    2222
    2323class BandwidthGroup;
     
    2929
    3030class ATL_NO_VTABLE BandwidthControl :
    31     public VirtualBoxBase,
    32     VBOX_SCRIPTABLE_IMPL(IBandwidthControl)
     31    public BandwidthControlWrap
    3332{
    3433public:
    35     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(BandwidthControl, IBandwidthControl)
    3634
    37     DECLARE_NOT_AGGREGATABLE(BandwidthControl)
     35    DECLARE_EMPTY_CTOR_DTOR(BandwidthControl)
    3836
    39     DECLARE_PROTECT_FINAL_CONSTRUCT()
    40 
    41     BEGIN_COM_MAP(BandwidthControl)
    42         VBOX_DEFAULT_INTERFACE_ENTRIES(IBandwidthControl)
    43     END_COM_MAP()
    44 
    45     BandwidthControl() { };
    46     ~BandwidthControl() { };
     37    HRESULT FinalConstruct();
     38    void FinalRelease();
    4739
    4840    // public initializer/uninitializer for internal purposes only
     
    5244    void uninit();
    5345
    54     STDMETHOD(CreateBandwidthGroup) (IN_BSTR aName, BandwidthGroupType_T aType, LONG64 aMaxBytesPerSec);
    55     STDMETHOD(DeleteBandwidthGroup) (IN_BSTR aName);
    56     STDMETHOD(COMGETTER(NumGroups)) (ULONG *aGroups);
    57     STDMETHOD(GetBandwidthGroup) (IN_BSTR aName, IBandwidthGroup **aBandwidthGroup);
    58     STDMETHOD(GetAllBandwidthGroups) (ComSafeArrayOut(IBandwidthGroup *, aBandwidthGroups));
    59 
    60     HRESULT FinalConstruct();
    61     void FinalRelease();
    62 
    6346    // public internal methods
    64 
    65     HRESULT loadSettings(const settings::IOSettings &data);
    66     HRESULT saveSettings(settings::IOSettings &data);
    67 
    68     void rollback();
    69     void commit();
    70     void copyFrom (BandwidthControl *aThat);
    71 
    72     Machine *getMachine() const;
    73 
    74     HRESULT getBandwidthGroupByName(const Utf8Str &aName,
    75                                     ComObjPtr<BandwidthGroup> &aBandwidthGroup,
    76                                     bool aSetError /* = false */);
     47    HRESULT i_loadSettings(const settings::IOSettings &data);
     48    HRESULT i_saveSettings(settings::IOSettings &data);
     49    void i_rollback();
     50    void i_commit();
     51    void i_copyFrom(BandwidthControl *aThat);
     52    Machine *i_getMachine() const;
     53    HRESULT i_getBandwidthGroupByName(const Utf8Str &aName,
     54                                      ComObjPtr<BandwidthGroup> &aBandwidthGroup,
     55                                      bool aSetError /* = false */);
    7756
    7857private:
    79     struct Data;
     58
     59    // wrapped IBandwidthControl properties
     60    HRESULT getNumGroups(ULONG *aNumGroups);
     61
     62    // wrapped IBandwidthControl methods
     63    HRESULT createBandwidthGroup(const com::Utf8Str &aName,
     64                                       BandwidthGroupType_T aType,
     65                                       LONG64 aMaxBytesPerSec);
     66    HRESULT deleteBandwidthGroup(const com::Utf8Str &aName);
     67    HRESULT getBandwidthGroup(const com::Utf8Str &aName,
     68                                    ComPtr<IBandwidthGroup> &aBandwidthGroup);
     69    HRESULT getAllBandwidthGroups(std::vector<ComPtr<IBandwidthGroup> > &aBandwidthGroups);
     70
     71    // Data
     72    typedef std::list< ComObjPtr<BandwidthGroup> > BandwidthGroupList;
     73
     74    struct Data
     75    {
     76        Data(Machine *pMachine)
     77        : pParent(pMachine)
     78        { }
     79
     80        ~Data()
     81        {};
     82
     83        Machine * const                 pParent;
     84
     85        // peer machine's bandwidth control
     86        const ComObjPtr<BandwidthControl>  pPeer;
     87
     88        // the following fields need special backup/rollback/commit handling,
     89        // so they cannot be a part of BackupableData
     90        Backupable<BandwidthGroupList>    llBandwidthGroups;
     91    };
     92
    8093    Data *m;
    8194};
  • trunk/src/VBox/Main/include/BandwidthGroupImpl.h

    r44528 r49644  
    55
    66/*
    7  * Copyright (C) 2006-2012 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_BANDWIDTHGROUPIMPL
    2020
    21 #include "VirtualBoxBase.h"
    2221#include "BandwidthControlImpl.h"
     22#include "BandwidthGroupWrap.h"
     23
    2324
    2425class ATL_NO_VTABLE BandwidthGroup :
    25     public VirtualBoxBase,
    26     VBOX_SCRIPTABLE_IMPL(IBandwidthGroup)
     26    public BandwidthGroupWrap
    2727{
    2828public:
    29     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(BandwidthGroup, IBandwidthGroup)
    3029
    31     DECLARE_NOT_AGGREGATABLE(BandwidthGroup)
     30    DECLARE_EMPTY_CTOR_DTOR(BandwidthGroup)
    3231
    33     DECLARE_PROTECT_FINAL_CONSTRUCT()
    34 
    35     BEGIN_COM_MAP(BandwidthGroup)
    36         VBOX_DEFAULT_INTERFACE_ENTRIES(IBandwidthGroup)
    37     END_COM_MAP()
    38 
    39     BandwidthGroup() { };
    40     ~BandwidthGroup() { };
     32    HRESULT FinalConstruct();
     33    void FinalRelease();
    4134
    4235    // public initializer/uninitializer for internal purposes only
     
    4942    void uninit();
    5043
    51     HRESULT FinalConstruct();
    52     void FinalRelease();
     44    // public methods only for internal purposes
     45    void i_rollback();
     46    void i_commit();
     47    void i_unshare();
     48    void i_reference();
     49    void i_release();
    5350
    54     STDMETHOD(COMGETTER(Name))(BSTR *aName);
    55     STDMETHOD(COMGETTER(Type))(BandwidthGroupType_T *aType);
    56     STDMETHOD(COMGETTER(Reference))(ULONG *aReferences);
    57     STDMETHOD(COMGETTER(MaxBytesPerSec))(LONG64 *aMaxBytesPerSec);
    58     STDMETHOD(COMSETTER(MaxBytesPerSec))(LONG64 aMaxBytesPerSec);
    59 
    60     // public methods only for internal purposes
    61     void rollback();
    62     void commit();
    63     void unshare();
    64 
    65     const Utf8Str &getName() const;
    66     BandwidthGroupType_T getType() const;
    67     LONG64 getMaxBytesPerSec() const;
    68     ULONG getReferences() const;
    69 
    70     void reference();
    71     void release();
    72 
    73     ComObjPtr<BandwidthGroup> getPeer();
     51    ComObjPtr<BandwidthGroup> i_getPeer() { return m->pPeer; }
     52    const Utf8Str &i_getName() const { return m->bd->strName; }
     53    BandwidthGroupType_T i_getType() const { return m->bd->enmType; }
     54    LONG64 i_getMaxBytesPerSec() const { return m->bd->aMaxBytesPerSec; }
     55    ULONG i_getReferences() const { return m->bd->cReferences; }
    7456
    7557private:
    76     struct Data;
     58
     59    // wrapped IBandwidthGroup properties
     60    HRESULT getName(com::Utf8Str &aName);
     61    HRESULT getType(BandwidthGroupType_T *aType);
     62    HRESULT getReference(ULONG *aReferences);
     63    HRESULT getMaxBytesPerSec(LONG64 *aMaxBytesPerSec);
     64    HRESULT setMaxBytesPerSec(LONG64 MaxBytesPerSec);
     65
     66    ////////////////////////////////////////////////////////////////////////////////
     67    ////
     68    //// private member data definition
     69    ////
     70    //////////////////////////////////////////////////////////////////////////////////
     71    //
     72    struct BackupableBandwidthGroupData
     73    {
     74       BackupableBandwidthGroupData()
     75           : enmType(BandwidthGroupType_Null),
     76             aMaxBytesPerSec(0),
     77             cReferences(0)
     78       { }
     79
     80       Utf8Str                 strName;
     81       BandwidthGroupType_T    enmType;
     82       LONG64                  aMaxBytesPerSec;
     83       ULONG                   cReferences;
     84    };
     85
     86    struct Data
     87    {
     88        Data(BandwidthControl * const aBandwidthControl)
     89            : pParent(aBandwidthControl),
     90              pPeer(NULL)
     91        { }
     92
     93       BandwidthControl * const    pParent;
     94       ComObjPtr<BandwidthGroup>   pPeer;
     95
     96       // use the XML settings structure in the members for simplicity
     97       Backupable<BackupableBandwidthGroupData> bd;
     98    };
     99
    77100    Data *m;
    78101};
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r49618 r49644  
    77
    88/*
    9  * Copyright (C) 2006-2011 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_H_DHCPSERVERIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "DHCPServerWrap.h"
    2424
    2525#ifdef VBOX_WITH_HOSTNETIF_API
     
    7373
    7474class ATL_NO_VTABLE DHCPServer :
    75     public VirtualBoxBase,
    76     VBOX_SCRIPTABLE_IMPL(IDHCPServer)
     75    public DHCPServerWrap
    7776{
    7877public:
    79 
    80     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(DHCPServer, IDHCPServer)
    81 
    82     DECLARE_NOT_AGGREGATABLE (DHCPServer)
    83 
    84     DECLARE_PROTECT_FINAL_CONSTRUCT()
    85 
    86     BEGIN_COM_MAP (DHCPServer)
    87         VBOX_DEFAULT_INTERFACE_ENTRIES(IDHCPServer)
    88     END_COM_MAP()
    8978
    9079    DECLARE_EMPTY_CTOR_DTOR (DHCPServer)
     
    9786    HRESULT init(VirtualBox *aVirtualBox,
    9887                 const settings::DHCPServer &data);
    99     HRESULT saveSettings(settings::DHCPServer &data);
    100 
    10188    void uninit();
    10289
    103     // IDHCPServer properties
    104     STDMETHOD(COMGETTER(NetworkName))(BSTR *aName);
    105     STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
    106     STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
    107     STDMETHOD(COMGETTER(IPAddress))(BSTR *aIPAddress);
    108     STDMETHOD(COMGETTER(NetworkMask))(BSTR *aNetworkMask);
    109     STDMETHOD(COMGETTER(LowerIP))(BSTR *aIPAddress);
    110     STDMETHOD(COMGETTER(UpperIP))(BSTR *aIPAddress);
    111 
    112     STDMETHOD(AddGlobalOption)(DhcpOpt_T aOption, IN_BSTR aValue);
    113     STDMETHOD(COMGETTER(GlobalOptions))(ComSafeArrayOut(BSTR, aValue));
    114     STDMETHOD(COMGETTER(VmConfigs))(ComSafeArrayOut(BSTR, aValue));
    115     STDMETHOD(AddVmSlotOption)(IN_BSTR aVmName, LONG aSlot, DhcpOpt_T aOption, IN_BSTR aValue);
    116     STDMETHOD(RemoveVmSlotOptions)(IN_BSTR aVmName, LONG aSlot);
    117     STDMETHOD(GetVmSlotOptions)(IN_BSTR aVmName, LONG aSlot, ComSafeArrayOut(BSTR, aValues));
    118     STDMETHOD(GetMacOptions)(IN_BSTR aMAC, ComSafeArrayOut(BSTR, aValues));
    119     STDMETHOD(COMGETTER(EventSource))(IEventSource **aEventSource);
    120 
    121     STDMETHOD(SetConfiguration)(IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aFromIPAddress, IN_BSTR aToIPAddress);
    122 
    123     STDMETHOD(Start)(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType);
    124     STDMETHOD(Stop)();
     90    // Public internal methids.
     91    HRESULT i_saveSettings(settings::DHCPServer &data);
     92    DhcpOptionMap& i_findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
     93                                            LONG Slot);
    12594
    12695private:
    127     struct Data;
    128     Data *m;
     96
     97    // wrapped IDHCPServer properties
     98    HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
     99    HRESULT getEnabled(BOOL *aEnabled);
     100    HRESULT setEnabled(BOOL aEnabled);
     101    HRESULT getIPAddress(com::Utf8Str &aIPAddress);
     102    HRESULT getNetworkMask(com::Utf8Str &aNetworkMask);
     103    HRESULT getNetworkName(com::Utf8Str &aName);
     104    HRESULT getLowerIP(com::Utf8Str &aIPAddress);
     105    HRESULT getUpperIP(com::Utf8Str &aIPAddress);
     106    HRESULT getGlobalOptions(std::vector<com::Utf8Str> &aGlobalOptions);
     107    HRESULT getVmConfigs(std::vector<com::Utf8Str> &aVmConfigs);
     108    HRESULT getMacOptions(const com::Utf8Str &aMAC, std::vector<com::Utf8Str> &aValues);
     109    HRESULT setConfiguration(const com::Utf8Str &aIPAddress,
     110                             const com::Utf8Str &aNetworkMask,
     111                             const com::Utf8Str &aFromIPAddress,
     112                             const com::Utf8Str &aToIPAddress);
     113    HRESULT getVmSlotOptions(const com::Utf8Str &aVmName,
     114                             LONG aSlot,
     115                             std::vector<com::Utf8Str> &aValue);
     116
     117    // Wrapped IDHCPServer Methods
     118    HRESULT addGlobalOption(DhcpOpt_T aOption,
     119                            const com::Utf8Str &aValue);
     120    HRESULT addVmSlotOption(const com::Utf8Str &aVmName,
     121                            LONG aSlot,
     122                            DhcpOpt_T aOption,
     123                            const com::Utf8Str &aValue);
     124    HRESULT removeVmSlotOptions(const com::Utf8Str &aVmName,
     125                                LONG aSlot);
     126    HRESULT start(const com::Utf8Str &aNetworkName,
     127                  const com::Utf8Str &aTrunkName,
     128                  const com::Utf8Str &aTrunkType);
     129    HRESULT stop();
     130
     131
     132    struct Data
     133    {
     134        Data() : enabled(FALSE) {}
     135
     136        Bstr IPAddress;
     137        Bstr lowerIP;
     138        Bstr upperIP;
     139
     140        BOOL enabled;
     141        DHCPServerRunner dhcp;
     142
     143        DhcpOptionMap GlobalDhcpOptions;
     144        VmSlot2OptionsMap VmSlot2Options;
     145    };
     146
     147    Data m;
    129148    /** weak VirtualBox parent */
    130149    VirtualBox * const      mVirtualBox;
    131150    const Bstr mName;
    132151
    133     DhcpOptionMap& findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
    134                                           LONG Slot);
    135152};
    136153
  • trunk/src/VBox/Main/include/GuestOSTypeImpl.h

    r49074 r49644  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
     18    // static int i_vrdpServerVerifyPortsString(com::Utf8Str portRange);
    1819#ifndef ____H_GUESTOSTYPEIMPL
    1920#define ____H_GUESTOSTYPEIMPL
    2021
    21 #include "VirtualBoxBase.h"
    2222#include "Global.h"
    23 
    24 #include <VBox/ostypes.h>
     23#include "GuestOSTypeWrap.h"
    2524
    2625class ATL_NO_VTABLE GuestOSType :
    27     public VirtualBoxBase,
    28     VBOX_SCRIPTABLE_IMPL(IGuestOSType)
     26    public GuestOSTypeWrap
    2927{
    3028public:
    31     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestOSType, IGuestOSType)
    32 
    33     DECLARE_NOT_AGGREGATABLE(GuestOSType)
    34 
    35     DECLARE_PROTECT_FINAL_CONSTRUCT()
    36 
    37     BEGIN_COM_MAP(GuestOSType)
    38         VBOX_DEFAULT_INTERFACE_ENTRIES(IGuestOSType)
    39     END_COM_MAP()
    4029
    4130    DECLARE_EMPTY_CTOR_DTOR(GuestOSType)
     
    4837    void uninit();
    4938
    50     // IGuestOSType properties
    51     STDMETHOD(COMGETTER(FamilyId))(BSTR *aFamilyId);
    52     STDMETHOD(COMGETTER(FamilyDescription))(BSTR *aFamilyDescription);
    53     STDMETHOD(COMGETTER(Id))(BSTR *aId);
    54     STDMETHOD(COMGETTER(Description))(BSTR *aDescription);
    55     STDMETHOD(COMGETTER(Is64Bit))(BOOL *aIs64Bit);
    56     STDMETHOD(COMGETTER(RecommendedIOAPIC))(BOOL *aRecommendedIOAPIC);
    57     STDMETHOD(COMGETTER(RecommendedVirtEx))(BOOL *aRecommendedVirtEx);
    58     STDMETHOD(COMGETTER(RecommendedRAM))(ULONG *aRAMSize);
    59     STDMETHOD(COMGETTER(RecommendedVRAM))(ULONG *aVRAMSize);
    60     STDMETHOD(COMGETTER(Recommended2DVideoAcceleration))(BOOL *aRecommended2DVideoAcceleration);
    61     STDMETHOD(COMGETTER(Recommended3DAcceleration))(BOOL *aRecommended3DAcceleration);
    62     STDMETHOD(COMGETTER(RecommendedHDD))(LONG64 *aHDDSize);
    63     STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aNetworkAdapterType);
    64     STDMETHOD(COMGETTER(RecommendedFirmware))(FirmwareType_T *aFirmwareType);
    65     STDMETHOD(COMGETTER(RecommendedDVDStorageBus))(StorageBus_T *aStorageBusType);
    66     STDMETHOD(COMGETTER(RecommendedDVDStorageController))(StorageControllerType_T *aStorageControllerType);
    67     STDMETHOD(COMGETTER(RecommendedHDStorageBus))(StorageBus_T *aStorageBusType);
    68     STDMETHOD(COMGETTER(RecommendedHDStorageController))(StorageControllerType_T *aStorageControllerType);
    69     STDMETHOD(COMGETTER(RecommendedPAE))(BOOL *aRecommendedExtHw);
    70     STDMETHOD(COMGETTER(RecommendedUSBHID))(BOOL *aRecommendedUSBHID);
    71     STDMETHOD(COMGETTER(RecommendedHPET))(BOOL *aRecommendedHPET);
    72     STDMETHOD(COMGETTER(RecommendedUSBTablet))(BOOL *aRecommendedUSBTablet);
    73     STDMETHOD(COMGETTER(RecommendedRTCUseUTC))(BOOL *aRecommendedRTCUseUTC);
    74     STDMETHOD(COMGETTER(RecommendedChipset))(ChipsetType_T *aChipsetType);
    75     STDMETHOD(COMGETTER(RecommendedAudioController))(AudioControllerType_T *aAudioController);
    76     STDMETHOD(COMGETTER(RecommendedFloppy))(BOOL *aRecommendedFloppy);
    77     STDMETHOD(COMGETTER(RecommendedUSB))(BOOL *aRecommendedUSB);
    78     STDMETHOD(COMGETTER(RecommendedTFReset))(BOOL *aRecommendedTFReset);
    79 
    8039    // public methods only for internal purposes
    81     const Bstr &id() const { return mID; }
    82     bool is64Bit() const { return !!(mOSHint & VBOXOSHINT_64BIT); }
    83     bool recommendedIOAPIC() const { return !!(mOSHint & VBOXOSHINT_IOAPIC); }
    84     bool recommendedVirtEx() const { return !!(mOSHint & VBOXOSHINT_HWVIRTEX); }
    85     bool recommendedEFI() const { return !!(mOSHint & VBOXOSHINT_EFI); }
    86     NetworkAdapterType_T networkAdapterType() const { return mNetworkAdapterType; }
    87     uint32_t numSerialEnabled() const { return mNumSerialEnabled; }
     40    const Bstr &i_id() const { return mID; }
     41    bool i_is64Bit() const { return !!(mOSHint & VBOXOSHINT_64BIT); }
     42    bool i_recommendedIOAPIC() const { return !!(mOSHint & VBOXOSHINT_IOAPIC); }
     43    bool i_recommendedVirtEx() const { return !!(mOSHint & VBOXOSHINT_HWVIRTEX); }
     44    bool i_recommendedEFI() const { return !!(mOSHint & VBOXOSHINT_EFI); }
     45    NetworkAdapterType_T i_networkAdapterType() const { return mNetworkAdapterType; }
     46    uint32_t i_numSerialEnabled() const { return mNumSerialEnabled; }
    8847
    8948private:
     49
     50    // Wrapped IGuestOSType properties
     51    HRESULT getFamilyId(com::Utf8Str &aFamilyId);
     52    HRESULT getFamilyDescription(com::Utf8Str &aFamilyDescription);
     53    HRESULT getId(com::Utf8Str &aId);
     54    HRESULT getDescription(com::Utf8Str &aDescription);
     55    HRESULT getIs64Bit(BOOL *aIs64Bit);
     56    HRESULT getRecommendedIOAPIC(BOOL *aRecommendedIOAPIC);
     57    HRESULT getRecommendedVirtEx(BOOL *aRecommendedVirtEx);
     58    HRESULT getRecommendedRAM(ULONG *RAMSize);
     59    HRESULT getRecommendedVRAM(ULONG *aVRAMSize);
     60    HRESULT getRecommended2DVideoAcceleration(BOOL *aRecommended2DVideoAcceleration);
     61    HRESULT getRecommended3DAcceleration(BOOL *aRecommended3DAcceleration);
     62    HRESULT getRecommendedHDD(LONG64 *aHDDSize);
     63    HRESULT getAdapterType(NetworkAdapterType_T *aNetworkAdapterType);
     64    HRESULT getRecommendedPAE(BOOL *aRecommendedPAE);
     65    HRESULT getRecommendedDVDStorageController(StorageControllerType_T *aStorageControllerType);
     66    HRESULT getRecommendedFirmware(FirmwareType_T *aFirmwareType);
     67    HRESULT getRecommendedDVDStorageBus(StorageBus_T *aStorageBusType);
     68    HRESULT getRecommendedHDStorageController(StorageControllerType_T *aStorageControllerType);
     69    HRESULT getRecommendedHDStorageBus(StorageBus_T *aStorageBusType);
     70    HRESULT getRecommendedUSBHID(BOOL *aRecommendedUSBHID);
     71    HRESULT getRecommendedHPET(BOOL *aRecommendedHPET);
     72    HRESULT getRecommendedUSBTablet(BOOL *aRecommendedUSBTablet);
     73    HRESULT getRecommendedRTCUseUTC(BOOL *aRecommendedRTCUseUTC);
     74    HRESULT getRecommendedChipset(ChipsetType_T *aChipsetType);
     75    HRESULT getRecommendedAudioController(AudioControllerType_T *aAudioController);
     76    HRESULT getRecommendedFloppy(BOOL *aRecommendedFloppy);
     77    HRESULT getRecommendedUSB(BOOL *aRecommendedUSB);
     78    HRESULT getRecommendedTFReset(BOOL *aRecommendedTFReset);
     79
    9080
    9181    const Bstr mFamilyID;
  • trunk/src/VBox/Main/include/MachineImpl.h

    r49059 r49644  
    814814                              bool fSetError = false)
    815815    {
    816         return mBandwidthControl->getBandwidthGroupByName(strBandwidthGroup,
    817                                                           pBandwidthGroup,
    818                                                           fSetError);
     816        return mBandwidthControl->i_getBandwidthGroupByName(strBandwidthGroup,
     817                                                            pBandwidthGroup,
     818                                                            fSetError);
    819819    }
    820820
  • trunk/src/VBox/Main/include/SerialPortImpl.h

    r41214 r49644  
    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_SERIALPORTIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "SerialPortWrap.h"
    2424
    2525class GuestOSType;
     
    3131
    3232class ATL_NO_VTABLE SerialPort :
    33     public VirtualBoxBase,
    34     VBOX_SCRIPTABLE_IMPL(ISerialPort)
     33    public SerialPortWrap
    3534{
    3635public:
    37     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(SerialPort, ISerialPort)
    3836
    39     DECLARE_NOT_AGGREGATABLE(SerialPort)
    40 
    41     DECLARE_PROTECT_FINAL_CONSTRUCT()
    42 
    43     BEGIN_COM_MAP(SerialPort)
    44         VBOX_DEFAULT_INTERFACE_ENTRIES (ISerialPort)
    45     END_COM_MAP()
    46 
    47     DECLARE_EMPTY_CTOR_DTOR (SerialPort)
     37    DECLARE_EMPTY_CTOR_DTOR(SerialPort)
    4838
    4939    HRESULT FinalConstruct();
     
    5646    void uninit();
    5747
    58     // ISerialPort properties
    59     STDMETHOD(COMGETTER(Slot))     (ULONG     *aSlot);
    60     STDMETHOD(COMGETTER(Enabled))  (BOOL      *aEnabled);
    61     STDMETHOD(COMSETTER(Enabled))  (BOOL       aEnabled);
    62     STDMETHOD(COMGETTER(HostMode)) (PortMode_T *aHostMode);
    63     STDMETHOD(COMSETTER(HostMode)) (PortMode_T  aHostMode);
    64     STDMETHOD(COMGETTER(IRQ))      (ULONG     *aIRQ);
    65     STDMETHOD(COMSETTER(IRQ))      (ULONG      aIRQ);
    66     STDMETHOD(COMGETTER(IOBase) )  (ULONG     *aIOBase);
    67     STDMETHOD(COMSETTER(IOBase))   (ULONG      aIOBase);
    68     STDMETHOD(COMGETTER(Path))     (BSTR      *aPath);
    69     STDMETHOD(COMSETTER(Path))     (IN_BSTR aPath);
    70     STDMETHOD(COMGETTER(Server))   (BOOL      *aServer);
    71     STDMETHOD(COMSETTER(Server))   (BOOL       aServer);
     48    // public methods only for internal purposes
     49    HRESULT i_loadSettings(const settings::SerialPort &data);
     50    HRESULT i_saveSettings(settings::SerialPort &data);
    7251
    73     // public methods only for internal purposes
     52    bool i_isModified();
     53    void i_rollback();
     54    void i_commit();
     55    void i_copyFrom(SerialPort *aThat);
    7456
    75     HRESULT loadSettings(const settings::SerialPort &data);
    76     HRESULT saveSettings(settings::SerialPort &data);
    77 
    78     bool isModified();
    79     void rollback();
    80     void commit();
    81     void copyFrom(SerialPort *aThat);
    82 
    83     void applyDefaults (GuestOSType *aOsType);
     57    void i_applyDefaults (GuestOSType *aOsType);
    8458
    8559    // public methods for internal purposes only
     
    8761
    8862private:
    89     HRESULT checkSetPath(const Utf8Str &str);
    9063
    91     struct Data;
     64    HRESULT i_checkSetPath(const Utf8Str &str);
     65
     66    // Wrapped ISerialPort properties
     67    HRESULT getEnabled(BOOL *aEnabled);
     68    HRESULT setEnabled(BOOL aEnabled);
     69    HRESULT getHostMode(PortMode_T *aHostMode);
     70    HRESULT setHostMode(PortMode_T aHostMode);
     71    HRESULT getSlot(ULONG *aSlot);
     72    HRESULT getIRQ(ULONG *aIRQ);
     73    HRESULT setIRQ(ULONG aIRQ);
     74    HRESULT getIOBase(ULONG *aIOBase);
     75    HRESULT setIOBase(ULONG aIOBase);
     76    HRESULT getServer(BOOL *aServer);
     77    HRESULT setServer(BOOL aServer);
     78    HRESULT getPath(com::Utf8Str &aPath);
     79    HRESULT setPath(const com::Utf8Str &aPath);
     80
     81    ////////////////////////////////////////////////////////////////////////////////
     82    ////
     83    //// SerialPort private data definition
     84    ////
     85    //////////////////////////////////////////////////////////////////////////////////
     86    //
     87    struct Data
     88    {
     89      Data()
     90           : fModified(false),
     91             pMachine(NULL)
     92        { }
     93
     94       bool                                fModified;
     95       Machine * const                     pMachine;
     96       const ComObjPtr<SerialPort>         pPeer;
     97       Backupable<settings::SerialPort>    bd;
     98    };
     99
    92100    Data *m;
    93101};
  • trunk/src/VBox/Main/include/StorageControllerImpl.h

    r44529 r49644  
    77
    88/*
    9  * Copyright (C) 2008-2012 Oracle Corporation
     9 * Copyright (C) 2008-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#ifndef ____H_STORAGECONTROLLERIMPL
    2121#define ____H_STORAGECONTROLLERIMPL
    22 
    23 #include "VirtualBoxBase.h"
     22#include "StorageControllerWrap.h"
    2423
    2524class ATL_NO_VTABLE StorageController :
    26     public VirtualBoxBase,
    27     VBOX_SCRIPTABLE_IMPL(IStorageController)
     25    public StorageControllerWrap
    2826{
    2927public:
    3028
    31     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(StorageController, IStorageController)
    32 
    33     DECLARE_NOT_AGGREGATABLE (StorageController)
    34 
    35     DECLARE_PROTECT_FINAL_CONSTRUCT()
    36 
    37     BEGIN_COM_MAP(StorageController)
    38         VBOX_DEFAULT_INTERFACE_ENTRIES (IStorageController)
    39     END_COM_MAP()
    40 
    41     StorageController() { };
    42     ~StorageController() { };
     29    DECLARE_EMPTY_CTOR_DTOR(StorageController)
    4330
    4431    HRESULT FinalConstruct();
     
    5845    void uninit();
    5946
    60     // IStorageController properties
    61     STDMETHOD(COMGETTER(Name)) (BSTR *aName);
    62     STDMETHOD(COMGETTER(Bus)) (StorageBus_T *aBus);
    63     STDMETHOD(COMGETTER(ControllerType)) (StorageControllerType_T *aControllerType);
    64     STDMETHOD(COMSETTER(ControllerType)) (StorageControllerType_T aControllerType);
    65     STDMETHOD(COMGETTER(MaxDevicesPerPortCount)) (ULONG *aMaxDevices);
    66     STDMETHOD(COMGETTER(MinPortCount)) (ULONG *aMinPortCount);
    67     STDMETHOD(COMGETTER(MaxPortCount)) (ULONG *aMaxPortCount);
    68     STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount);
    69     STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount);
    70     STDMETHOD(COMGETTER(Instance)) (ULONG *aInstance);
    71     STDMETHOD(COMSETTER(Instance)) (ULONG aInstance);
    72     STDMETHOD(COMGETTER(UseHostIOCache)) (BOOL *fUseHostIOCache);
    73     STDMETHOD(COMSETTER(UseHostIOCache)) (BOOL fUseHostIOCache);
    74     STDMETHOD(COMGETTER(Bootable)) (BOOL *fBootable);
    75 
    7647    // public methods only for internal purposes
    77 
    78     const Utf8Str &getName() const;
    79     StorageControllerType_T getControllerType() const;
    80     StorageBus_T getStorageBus() const;
    81     ULONG getInstance() const;
    82     bool getBootable() const;
    83 
    84     HRESULT checkPortAndDeviceValid(LONG aControllerPort,
    85                                     LONG aDevice);
    86 
    87     void setBootable(BOOL fBootable);
    88 
    89     void rollback();
    90     void commit();
    91     HRESULT getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);
    92     HRESULT setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);
     48    const Utf8Str &i_getName() const;
     49    StorageControllerType_T i_getControllerType() const;
     50    StorageBus_T i_getStorageBus() const;
     51    ULONG i_getInstance() const;
     52    bool i_getBootable() const;
     53    HRESULT i_checkPortAndDeviceValid(LONG aControllerPort,
     54                                      LONG aDevice);
     55    void i_setBootable(BOOL fBootable);
     56    void i_rollback();
     57    void i_commit();
     58    HRESULT i_getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);
     59    HRESULT i_setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);
    9360
    9461    // public methods for internal purposes only
    9562    // (ensure there is a caller and a read lock before calling them!)
    9663
    97     void unshare();
     64    void i_unshare();
    9865
    9966    /** @note this doesn't require a read lock since mParent is constant. */
    100     Machine* getMachine();
    101 
    102     ComObjPtr<StorageController> getPeer();
     67    Machine* i_getMachine();
     68    ComObjPtr<StorageController> i_getPeer();
    10369
    10470private:
    10571
    106     void printList();
     72    // Wrapped IStorageController properties
     73    HRESULT getName(com::Utf8Str &aName);
     74    HRESULT getMaxDevicesPerPortCount(ULONG *aMaxDevicesPerPortCount);
     75    HRESULT getMinPortCount(ULONG *aMinPortCount);
     76    HRESULT getMaxPortCount(ULONG *aMaxPortCount);
     77    HRESULT getInstance(ULONG *aInstance);
     78    HRESULT setInstance(ULONG aInstance);
     79    HRESULT getPortCount(ULONG *aPortCount);
     80    HRESULT setPortCount(ULONG aPortCount);
     81    HRESULT getBus(StorageBus_T *aBus);
     82    HRESULT getControllerType(StorageControllerType_T *aControllerType);
     83    HRESULT setControllerType(StorageControllerType_T aControllerType);
     84    HRESULT getUseHostIOCache(BOOL *aUseHostIOCache);
     85    HRESULT setUseHostIOCache(BOOL aUseHostIOCache);
     86    HRESULT getBootable(BOOL *aBootable);
     87
     88    void i_printList();
    10789
    10890    struct Data;
  • trunk/src/VBox/Main/include/VFSExplorerImpl.h

    r47922 r49644  
    77
    88/*
    9  * Copyright (C) 2009-2011 Oracle Corporation
     9 * Copyright (C) 2009-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121#define ____H_VFSEXPLORERIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "VFSExplorerWrap.h"
    2424
    2525class ATL_NO_VTABLE VFSExplorer :
    26     public VirtualBoxBase,
    27     VBOX_SCRIPTABLE_IMPL(IVFSExplorer)
     26    public VFSExplorerWrap
    2827{
    29     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(VFSExplorer, IVFSExplorer)
    30 
    31     DECLARE_NOT_AGGREGATABLE(VFSExplorer)
    32 
    33     DECLARE_PROTECT_FINAL_CONSTRUCT()
    34 
    35     BEGIN_COM_MAP(VFSExplorer)
    36         VBOX_DEFAULT_INTERFACE_ENTRIES(IVFSExplorer)
    37     END_COM_MAP()
     28public:
    3829
    3930    DECLARE_EMPTY_CTOR_DTOR(VFSExplorer)
     
    4637    void uninit();
    4738
    48     /* IVFSExplorer properties */
    49     STDMETHOD(COMGETTER(Path))(BSTR *aPath);
    50     STDMETHOD(COMGETTER(Type))(VFSType_T *aType);
    51 
    52     /* IVFSExplorer methods */
    53     STDMETHOD(Update)(IProgress **aProgress);
    54 
    55     STDMETHOD(Cd)(IN_BSTR aDir, IProgress **aProgress);
    56     STDMETHOD(CdUp)(IProgress **aProgress);
    57 
    58     STDMETHOD(EntryList)(ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(VFSFileType_T, aTypes), ComSafeArrayOut(LONG64, aSizes), ComSafeArrayOut(ULONG, aModes));
    59 
    60     STDMETHOD(Exists)(ComSafeArrayIn(IN_BSTR, aNames), ComSafeArrayOut(BSTR, aExists));
    61 
    62     STDMETHOD(Remove)(ComSafeArrayIn(IN_BSTR, aNames), IProgress **aProgress);
    63 
    6439    /* public methods only for internal purposes */
    65 
    6640    static HRESULT setErrorStatic(HRESULT aResultCode,
    6741                                  const Utf8Str &aText)
     
    7145
    7246private:
     47
     48    // wrapped IVFSExplorer properties
     49    HRESULT getPath(com::Utf8Str &aPath);
     50    HRESULT getType(VFSType_T *aType);
     51
     52   // wrapped IVFSExplorer methods
     53    HRESULT update(ComPtr<IProgress> &aProgress);
     54    HRESULT cd(const com::Utf8Str &aDir, ComPtr<IProgress> &aProgress);
     55    HRESULT cdUp(ComPtr<IProgress> &aProgress);
     56    HRESULT entryList(std::vector<com::Utf8Str> &aNames,
     57                      std::vector<ULONG> &aTypes,
     58                      std::vector<LONG64> &aSizes,
     59                      std::vector<ULONG> &aModes);
     60    HRESULT exists(const std::vector<com::Utf8Str> &aNames,
     61                   std::vector<com::Utf8Str> &aExists);
     62    HRESULT remove(const std::vector<com::Utf8Str> &aNames,
     63                   ComPtr<IProgress> &aProgress);
     64
    7365    /* Private member vars */
    7466    VirtualBox * const  mVirtualBox;
    7567
     68    ////////////////////////////////////////////////////////////////////////////////
     69    ////
     70    //// VFSExplorer definitions
     71    ////
     72    //////////////////////////////////////////////////////////////////////////////////
     73    //
    7674    struct TaskVFSExplorer;  /* Worker thread helper */
    77     struct Data;
     75    struct Data
     76    {
     77        struct DirEntry
     78        {
     79            DirEntry(Utf8Str strName, VFSFileType_T fileType, uint64_t cbSize, uint32_t fMode)
     80               : name(strName)
     81               , type(fileType)
     82               , size(cbSize)
     83               , mode(fMode) {}
     84
     85             Utf8Str name;
     86             VFSFileType_T type;
     87             uint64_t size;
     88             uint32_t mode;
     89        };
     90
     91        VFSType_T storageType;
     92        Utf8Str strUsername;
     93        Utf8Str strPassword;
     94        Utf8Str strHostname;
     95        Utf8Str strPath;
     96        Utf8Str strBucket;
     97        std::list<DirEntry> entryList;
     98    };
     99
    78100    Data *m;
    79101
    80102    /* Private member methods */
    81     VFSFileType_T RTToVFSFileType(int aType) const;
     103    VFSFileType_T i_RTToVFSFileType(int aType) const;
    82104
    83     HRESULT updateFS(TaskVFSExplorer *aTask);
    84     HRESULT deleteFS(TaskVFSExplorer *aTask);
    85     HRESULT updateS3(TaskVFSExplorer *aTask);
    86     HRESULT deleteS3(TaskVFSExplorer *aTask);
     105    HRESULT i_updateFS(TaskVFSExplorer *aTask);
     106    HRESULT i_deleteFS(TaskVFSExplorer *aTask);
     107    HRESULT i_updateS3(TaskVFSExplorer *aTask);
     108    HRESULT i_deleteS3(TaskVFSExplorer *aTask);
     109
    87110};
    88111
  • trunk/src/VBox/Main/include/VRDEServerImpl.h

    r45680 r49644  
    2121#define ____H_VRDPSERVER
    2222
    23 #include "VirtualBoxBase.h"
    24 
    25 #include <VBox/VBoxAuth.h>
    2623#include <VBox/settings.h>
     24#include "VRDEServerWrap.h"
    2725
    2826class ATL_NO_VTABLE VRDEServer :
    29     public VirtualBoxBase,
    30     VBOX_SCRIPTABLE_IMPL(IVRDEServer)
     27    public VRDEServerWrap
    3128{
    3229public:
    3330
    34     struct Data
    35     {
    36         BOOL mEnabled;
    37         Bstr mAuthLibrary;
    38         AuthType_T mAuthType;
    39         ULONG mAuthTimeout;
    40         BOOL mAllowMultiConnection;
    41         BOOL mReuseSingleConnection;
    42         Utf8Str mVrdeExtPack;
    43         settings::StringsMap mProperties;
    44     };
    45 
    46     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(VRDEServer, IVRDEServer)
    47 
    48     DECLARE_NOT_AGGREGATABLE(VRDEServer)
    49 
    50     DECLARE_PROTECT_FINAL_CONSTRUCT()
    51 
    52     BEGIN_COM_MAP(VRDEServer)
    53         VBOX_DEFAULT_INTERFACE_ENTRIES(IVRDEServer)
    54     END_COM_MAP()
     31    typedef std::map<com::Utf8Str, com::Utf8Str> StringsMap;
    5532
    5633    DECLARE_EMPTY_CTOR_DTOR(VRDEServer)
     
    6542    void uninit();
    6643
    67     // IVRDEServer properties
    68     STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
    69     STDMETHOD(COMSETTER(Enabled))(BOOL aEnable);
    70     STDMETHOD(COMGETTER(AuthType))(AuthType_T *aType);
    71     STDMETHOD(COMSETTER(AuthType))(AuthType_T aType);
    72     STDMETHOD(COMGETTER(AuthTimeout))(ULONG *aTimeout);
    73     STDMETHOD(COMSETTER(AuthTimeout))(ULONG aTimeout);
    74     STDMETHOD(COMGETTER(AllowMultiConnection))(BOOL *aAllowMultiConnection);
    75     STDMETHOD(COMSETTER(AllowMultiConnection))(BOOL aAllowMultiConnection);
    76     STDMETHOD(COMGETTER(ReuseSingleConnection))(BOOL *aReuseSingleConnection);
    77     STDMETHOD(COMSETTER(ReuseSingleConnection))(BOOL aReuseSingleConnection);
    78     STDMETHOD(COMGETTER(VRDEExtPack))(BSTR *aExtPack);
    79     STDMETHOD(COMSETTER(VRDEExtPack))(IN_BSTR aExtPack);
    80     STDMETHOD(COMGETTER(AuthLibrary))(BSTR *aValue);
    81     STDMETHOD(COMSETTER(AuthLibrary))(IN_BSTR aValue);
    82     STDMETHOD(COMGETTER(VRDEProperties))(ComSafeArrayOut(BSTR, aProperties));
    83 
    84     // IVRDEServer methods
    85     STDMETHOD(SetVRDEProperty)(IN_BSTR aKey, IN_BSTR aValue);
    86     STDMETHOD(GetVRDEProperty)(IN_BSTR aKey, BSTR *aValue);
    87 
    8844    // public methods only for internal purposes
    89 
    90     HRESULT loadSettings(const settings::VRDESettings &data);
    91     HRESULT saveSettings(settings::VRDESettings &data);
    92 
    93     void rollback();
    94     void commit();
    95     void copyFrom(VRDEServer *aThat);
     45    HRESULT i_loadSettings(const settings::VRDESettings &data);
     46    HRESULT i_saveSettings(settings::VRDESettings &data);
     47    void i_rollback();
     48    void i_commit();
     49    void i_copyFrom(VRDEServer *aThat);
    9650
    9751private:
     52
     53     // wrapped IVRDEServer properties
     54     HRESULT getEnabled(BOOL *aEnabled);
     55     HRESULT setEnabled(BOOL aEnabled);
     56     HRESULT getAuthType(AuthType_T *aAuthType);
     57     HRESULT setAuthType(AuthType_T aAuthType);
     58     HRESULT getAuthTimeout(ULONG *aAuthTimeout);
     59     HRESULT setAuthTimeout(ULONG aAuthTimeout);
     60     HRESULT getAllowMultiConnection(BOOL *aAllowMultiConnection);
     61     HRESULT setAllowMultiConnection(BOOL aAllowMultiConnection);
     62     HRESULT getReuseSingleConnection(BOOL *aReuseSingleConnection);
     63     HRESULT setReuseSingleConnection(BOOL aReuseSingleConnection);
     64     HRESULT getVRDEExtPack(com::Utf8Str &aVRDEExtPack);
     65     HRESULT setVRDEExtPack(const com::Utf8Str &aVRDEExtPack);
     66     HRESULT getAuthLibrary(com::Utf8Str &aAuthLibrary);
     67     HRESULT setAuthLibrary(const com::Utf8Str &aAuthLibrary);
     68     HRESULT getVRDEProperties(std::vector<com::Utf8Str> &aVRDEProperties);
     69
     70    // wrapped IVRDEServer methods
     71    HRESULT setVRDEProperty(const com::Utf8Str &aKey,
     72                            const com::Utf8Str &aValue);
     73    HRESULT getVRDEProperty(const com::Utf8Str &aKey,
     74                            com::Utf8Str &aValue);
     75
     76    struct Data
     77    {
     78        BOOL         mEnabled;
     79        com::Utf8Str mAuthLibrary;
     80        AuthType_T   mAuthType;
     81        ULONG        mAuthTimeout;
     82        BOOL         mAllowMultiConnection;
     83        BOOL         mReuseSingleConnection;
     84        Utf8Str      mVrdeExtPack;
     85        StringsMap   mProperties;
     86    };
    9887
    9988    Machine * const     mParent;
  • trunk/src/VBox/Main/src-client/PCIRawDevImpl.cpp

    r45030 r49644  
    55
    66/*
    7  * Copyright (C) 2010-2012 Oracle Corporation
     7 * Copyright (C) 2010-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp

    r48914 r49644  
    636636
    637637    /* Initialize default BIOS settings here */
    638     m->bd->fIOAPICEnabled = aOsType->recommendedIOAPIC();
     638    m->bd->fIOAPICEnabled = aOsType->i_recommendedIOAPIC();
    639639}
    640640
  • trunk/src/VBox/Main/src-server/BandwidthControlImpl.cpp

    r46820 r49644  
    3232/////////////////////////////////////////////////////////////////////////////
    3333
    34 typedef std::list< ComObjPtr<BandwidthGroup> > BandwidthGroupList;
    35 
    36 struct BandwidthControl::Data
    37 {
    38     Data(Machine *pMachine)
    39         : pParent(pMachine)
    40     { }
    41 
    42     ~Data()
    43     {};
    44 
    45     Machine * const                 pParent;
    46 
    47     // peer machine's bandwidth control
    48     const ComObjPtr<BandwidthControl>  pPeer;
    49 
    50     // the following fields need special backup/rollback/commit handling,
    51     // so they cannot be a part of BackupableData
    52     Backupable<BandwidthGroupList>    llBandwidthGroups;
    53 };
    54 
    5534// constructor / destructor
    5635/////////////////////////////////////////////////////////////////////////////
     36DEFINE_EMPTY_CTOR_DTOR(BandwidthControl)
     37
    5738
    5839HRESULT BandwidthControl::FinalConstruct()
     
    133114    /* create copies of all groups */
    134115    m->llBandwidthGroups.allocate();
    135     BandwidthGroupList::const_iterator it = aThat->m->llBandwidthGroups->begin();
    136     while (it != aThat->m->llBandwidthGroups->end())
     116    BandwidthGroupList::const_iterator it;
     117    for(it = aThat->m->llBandwidthGroups->begin();
     118        it != aThat->m->llBandwidthGroups->end();
     119        ++it)
    137120    {
    138121        ComObjPtr<BandwidthGroup> group;
     
    140123        group->init(this, *it);
    141124        m->llBandwidthGroups->push_back(group);
    142         ++ it;
    143125    }
    144126
     
    174156    /* create copies of all groups */
    175157    m->llBandwidthGroups.allocate();
    176     BandwidthGroupList::const_iterator it = aThat->m->llBandwidthGroups->begin();
    177     while (it != aThat->m->llBandwidthGroups->end())
     158    BandwidthGroupList::const_iterator it;
     159    for(it = aThat->m->llBandwidthGroups->begin();
     160        it != aThat->m->llBandwidthGroups->end();
     161        ++it)
    178162    {
    179163        ComObjPtr<BandwidthGroup> group;
     
    181165        group->init(this, *it);
    182166        m->llBandwidthGroups->push_back(group);
    183         ++ it;
    184167    }
    185168
     
    195178 *  represented by @a aThat (locked for reading).
    196179 */
    197 void BandwidthControl::copyFrom (BandwidthControl *aThat)
     180void BandwidthControl::i_copyFrom (BandwidthControl *aThat)
    198181{
    199182    AssertReturnVoid (aThat != NULL);
     
    221204    m->llBandwidthGroups.backup();
    222205    m->llBandwidthGroups->clear();
    223     for (BandwidthGroupList::const_iterator it = aThat->m->llBandwidthGroups->begin();
     206    BandwidthGroupList::const_iterator it;
     207    for(it = aThat->m->llBandwidthGroups->begin();
    224208        it != aThat->m->llBandwidthGroups->end();
    225         ++ it)
     209        ++it)
    226210    {
    227211        ComObjPtr<BandwidthGroup> group;
    228212        group.createObject();
    229213        group->initCopy (this, *it);
    230         m->llBandwidthGroups->push_back (group);
     214        m->llBandwidthGroups->push_back(group);
    231215    }
    232216}
    233217
    234218/** @note Locks objects for writing! */
    235 void BandwidthControl::rollback()
     219void BandwidthControl::i_rollback()
    236220{
    237221    AutoCaller autoCaller(this);
     
    243227
    244228    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     229    BandwidthGroupList::const_iterator it;
    245230
    246231    if (!m->llBandwidthGroups.isNull())
     
    249234        {
    250235            /* unitialize all new groups (absent in the backed up list). */
    251             BandwidthGroupList::const_iterator it = m->llBandwidthGroups->begin();
    252236            BandwidthGroupList *backedList = m->llBandwidthGroups.backedUpData();
    253             while (it != m->llBandwidthGroups->end())
     237            for(it  = m->llBandwidthGroups->begin();
     238                it != m->llBandwidthGroups->end();
     239                ++it)
    254240            {
    255241                if (   std::find(backedList->begin(), backedList->end(), *it)
    256                     == backedList->end()
    257                    )
    258                 {
     242                    == backedList->end())
    259243                    (*it)->uninit();
    260                 }
    261                 ++it;
    262244            }
    263245
     
    267249
    268250        /* rollback any changes to groups after restoring the list */
    269         BandwidthGroupList::const_iterator it = m->llBandwidthGroups->begin();
    270         while (it != m->llBandwidthGroups->end())
    271         {
    272             (*it)->rollback();
    273             ++it;
    274         }
    275     }
    276 }
    277 
    278 void BandwidthControl::commit()
     251        for(it = m->llBandwidthGroups->begin();
     252            it != m->llBandwidthGroups->end();
     253            ++it)
     254            (*it)->i_rollback();
     255    }
     256}
     257
     258void BandwidthControl::i_commit()
    279259{
    280260    bool commitBandwidthGroups = false;
     261    BandwidthGroupList::const_iterator it;
    281262
    282263    if (m->llBandwidthGroups.isBackedUp())
     
    291272             * peers for those who have peers) */
    292273            BandwidthGroupList *newList = new BandwidthGroupList();
    293             BandwidthGroupList::const_iterator it = m->llBandwidthGroups->begin();
    294             while (it != m->llBandwidthGroups->end())
     274            for(it = m->llBandwidthGroups->begin(); it != m->llBandwidthGroups->end(); ++it)
    295275            {
    296                 (*it)->commit();
     276                (*it)->i_commit();
    297277
    298278                /* look if this group has a peer group */
    299                 ComObjPtr<BandwidthGroup> peer = (*it)->getPeer();
     279                ComObjPtr<BandwidthGroup> peer = (*it)->i_getPeer();
    300280                if (!peer)
    301281                {
     
    317297
    318298            /* uninit old peer's controllers that are left */
    319             it = m->pPeer->m->llBandwidthGroups->begin();
    320             while (it != m->pPeer->m->llBandwidthGroups->end())
    321             {
     299            for(it = m->pPeer->m->llBandwidthGroups->begin();
     300                it != m->pPeer->m->llBandwidthGroups->end();
     301                ++it)
    322302                (*it)->uninit();
    323                 ++it;
    324             }
    325303
    326304            /* attach new list of controllers to our peer */
     
    343321    if (commitBandwidthGroups)
    344322    {
    345         BandwidthGroupList::const_iterator it = m->llBandwidthGroups->begin();
    346         while (it != m->llBandwidthGroups->end())
    347         {
    348             (*it)->commit();
    349             ++it;
    350         }
     323        for(it = m->llBandwidthGroups->begin();
     324            it != m->llBandwidthGroups->end();
     325            ++it)
     326            (*it)->i_commit();
    351327    }
    352328}
     
    367343    // uninit all groups on the list (it's a standard std::list not an ObjectsList
    368344    // so we must uninit() manually)
    369     for (BandwidthGroupList::iterator it = m->llBandwidthGroups->begin();
     345    BandwidthGroupList::iterator it;
     346    for (it = m->llBandwidthGroups->begin();
    370347         it != m->llBandwidthGroups->end();
    371348         ++it)
     
    385362 *
    386363 *  @param aName                 storage controller name to find
    387  *  @param aStorageController    where to return the found storage controller
     364 *  @param aBandwidthGroup where to return the found storage controller
    388365 *  @param aSetError             true to set extended error info on failure
    389366 */
    390 HRESULT BandwidthControl::getBandwidthGroupByName(const Utf8Str &aName,
    391                                                   ComObjPtr<BandwidthGroup> &aBandwidthGroup,
    392                                                   bool aSetError /* = false */)
     367HRESULT BandwidthControl::i_getBandwidthGroupByName(const com::Utf8Str &aName,
     368                                                    ComObjPtr<BandwidthGroup> &aBandwidthGroup,
     369                                                    bool aSetError /* = false */)
    393370{
    394371    AssertReturn(!aName.isEmpty(), E_INVALIDARG);
     
    398375         ++it)
    399376    {
    400         if ((*it)->getName() == aName)
     377        if ((*it)->i_getName() == aName)
    401378        {
    402379            aBandwidthGroup = (*it);
     
    411388    return VBOX_E_OBJECT_NOT_FOUND;
    412389}
    413 
    414 STDMETHODIMP BandwidthControl::CreateBandwidthGroup(IN_BSTR aName, BandwidthGroupType_T aType, LONG64 aMaxBytesPerSec)
     390// To do
     391HRESULT BandwidthControl::createBandwidthGroup(const com::Utf8Str &aName,
     392                                               BandwidthGroupType_T aType,
     393                                               LONG64 aMaxBytesPerSec)
    415394{
    416395    if (aMaxBytesPerSec < 0)
     
    418397                        tr("Bandwidth group limit cannot be negative"));
    419398
    420     AutoCaller autoCaller(this);
    421     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    422 
    423399    /* the machine needs to be mutable */
    424400    AutoMutableStateDependency adep(m->pParent);
     
    429405    /* try to find one with the name first. */
    430406    ComObjPtr<BandwidthGroup> group;
    431 
    432     HRESULT rc = getBandwidthGroupByName(aName, group, false /* aSetError */);
     407    HRESULT rc = i_getBandwidthGroupByName(aName, group, false /* aSetError */);
     408
    433409    if (SUCCEEDED(rc))
    434410        return setError(VBOX_E_OBJECT_IN_USE,
    435411                        tr("Bandwidth group named '%ls' already exists"),
    436                         aName);
     412                        Bstr(aName).raw());
    437413
    438414    group.createObject();
     
    448424}
    449425
    450 STDMETHODIMP BandwidthControl::DeleteBandwidthGroup(IN_BSTR aName)
    451 {
    452     CheckComArgStrNotEmptyOrNull(aName);
    453 
    454     AutoCaller autoCaller(this);
    455     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    456 
     426HRESULT BandwidthControl::deleteBandwidthGroup(const com::Utf8Str &aName)
     427{
    457428    /* the machine needs to be mutable */
    458429    AutoMutableStateDependency adep(m->pParent);
     
    462433
    463434    ComObjPtr<BandwidthGroup> group;
    464     HRESULT rc = getBandwidthGroupByName(aName, group, true /* aSetError */);
     435    HRESULT rc = i_getBandwidthGroupByName(aName, group, true /* aSetError */);
    465436    if (FAILED(rc)) return rc;
    466437
    467     if (group->getReferences() != 0)
     438    if (group->i_getReferences() != 0)
    468439        return setError(VBOX_E_OBJECT_IN_USE,
    469                         tr("The bandwidth group '%ls' is still in use"), aName);
     440                        tr("The bandwidth group '%ls' is still in use"), Bstr(aName).raw());
    470441
    471442    /* We can remove it now. */
     
    473444    m->llBandwidthGroups.backup();
    474445
    475     group->unshare();
     446    group->i_unshare();
    476447
    477448    m->llBandwidthGroups->remove(group);
     
    484455}
    485456
    486 STDMETHODIMP BandwidthControl::COMGETTER(NumGroups)(ULONG *aGroups)
    487 {
    488     CheckComArgNotNull(aGroups);
    489 
     457HRESULT BandwidthControl::getNumGroups(ULONG *aNumGroups)
     458{
     459    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     460
     461    *aNumGroups = m->llBandwidthGroups->size();
     462
     463    return S_OK;
     464}
     465
     466HRESULT BandwidthControl::getBandwidthGroup(const com::Utf8Str &aName, ComPtr<IBandwidthGroup> &aBandwidthGroup)
     467{
     468    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     469
     470    ComObjPtr<BandwidthGroup> group;
     471    HRESULT rc = i_getBandwidthGroupByName(aName, group, true /* aSetError */);
     472
     473    if (SUCCEEDED(rc))
     474        group.queryInterfaceTo(aBandwidthGroup.asOutParam());
     475
     476    return rc;
     477}
     478
     479HRESULT BandwidthControl::getAllBandwidthGroups(std::vector<ComPtr<IBandwidthGroup> > &aBandwidthGroups)
     480{
     481    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     482    aBandwidthGroups.resize(0);
     483    BandwidthGroupList::const_iterator it;
     484    for(it = m->llBandwidthGroups->begin();
     485        it != m->llBandwidthGroups->end();
     486        ++it)
     487        aBandwidthGroups.push_back(*it);
     488
     489    return S_OK;
     490}
     491
     492HRESULT BandwidthControl::i_loadSettings(const settings::IOSettings &data)
     493{
     494    HRESULT rc = S_OK;
     495
     496    AutoCaller autoCaller(this);
     497    AssertComRCReturnRC(autoCaller.rc());
     498    settings::BandwidthGroupList::const_iterator it;
     499    for(it = data.llBandwidthGroups.begin();
     500        it != data.llBandwidthGroups.end();
     501        ++it)
     502    {
     503        const settings::BandwidthGroup &gr = *it;
     504        rc = createBandwidthGroup(gr.strName, gr.enmType, gr.cMaxBytesPerSec);
     505        if (FAILED(rc)) break;
     506    }
     507
     508    return rc;
     509}
     510
     511HRESULT BandwidthControl::i_saveSettings(settings::IOSettings &data)
     512{
    490513    AutoCaller autoCaller(this);
    491514    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    492515
    493516    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    494 
    495     *aGroups = m->llBandwidthGroups->size();
    496 
    497     return S_OK;
    498 }
    499 
    500 STDMETHODIMP BandwidthControl::GetBandwidthGroup(IN_BSTR aName, IBandwidthGroup **aBandwidthGroup)
    501 {
    502     CheckComArgStrNotEmptyOrNull(aName);
    503 
    504     AutoCaller autoCaller(this);
    505     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    506 
    507     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    508 
    509     ComObjPtr<BandwidthGroup> group;
    510 
    511     HRESULT rc = getBandwidthGroupByName(aName, group, true /* aSetError */);
    512     if (SUCCEEDED(rc))
    513         group.queryInterfaceTo(aBandwidthGroup);
    514 
    515     return rc;
    516 }
    517 
    518 STDMETHODIMP BandwidthControl::GetAllBandwidthGroups(ComSafeArrayOut(IBandwidthGroup *, aBandwidthGroups))
    519 {
    520     CheckComArgOutSafeArrayPointerValid(aBandwidthGroups);
    521 
    522     AutoCaller autoCaller(this);
    523     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    524 
    525     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    526 
    527     SafeIfaceArray<IBandwidthGroup> collection (*m->llBandwidthGroups.data());
    528     collection.detachTo(ComSafeArrayOutArg(aBandwidthGroups));
    529 
    530     return S_OK;
    531 }
    532 
    533 HRESULT BandwidthControl::loadSettings(const settings::IOSettings &data)
    534 {
    535     HRESULT rc = S_OK;
    536 
    537     AutoCaller autoCaller(this);
    538     AssertComRCReturnRC(autoCaller.rc());
    539 
    540     for (settings::BandwidthGroupList::const_iterator it = data.llBandwidthGroups.begin();
    541         it != data.llBandwidthGroups.end();
     517    data.llBandwidthGroups.clear();
     518    BandwidthGroupList::const_iterator it;
     519    for(it = m->llBandwidthGroups->begin();
     520        it != m->llBandwidthGroups->end();
    542521        ++it)
    543     {
    544         const settings::BandwidthGroup &gr = *it;
    545         rc = CreateBandwidthGroup(Bstr(gr.strName).raw(), gr.enmType, gr.cMaxBytesPerSec);
    546         if (FAILED(rc)) break;
    547     }
    548 
    549     return rc;
    550 }
    551 
    552 HRESULT BandwidthControl::saveSettings(settings::IOSettings &data)
    553 {
    554     AutoCaller autoCaller(this);
    555     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    556 
    557     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    558 
    559     data.llBandwidthGroups.clear();
    560 
    561     for (BandwidthGroupList::const_iterator it = m->llBandwidthGroups->begin();
    562          it != m->llBandwidthGroups->end();
    563          ++it)
    564522    {
    565523        AutoWriteLock groupLock(*it COMMA_LOCKVAL_SRC_POS);
    566524        settings::BandwidthGroup group;
    567525
    568         group.strName      = (*it)->getName();
    569         group.enmType      = (*it)->getType();
    570         group.cMaxBytesPerSec = (*it)->getMaxBytesPerSec();
     526        group.strName      = (*it)->i_getName();
     527        group.enmType      = (*it)->i_getType();
     528        group.cMaxBytesPerSec = (*it)->i_getMaxBytesPerSec();
    571529
    572530        data.llBandwidthGroups.push_back(group);
     
    576534}
    577535
    578 Machine * BandwidthControl::getMachine() const
     536Machine * BandwidthControl::i_getMachine() const
    579537{
    580538    return m->pParent;
  • trunk/src/VBox/Main/src-server/BandwidthGroupImpl.cpp

    r41882 r49644  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2525#include <iprt/cpp/utils.h>
    2626
    27 ////////////////////////////////////////////////////////////////////////////////
    28 //
    29 // private member data definition
    30 //
    31 ////////////////////////////////////////////////////////////////////////////////
    32 
    33 struct BackupableBandwidthGroupData
    34 {
    35     BackupableBandwidthGroupData()
    36         : enmType(BandwidthGroupType_Null),
    37           aMaxBytesPerSec(0),
    38           cReferences(0)
    39     { }
    40 
    41     Utf8Str                 strName;
    42     BandwidthGroupType_T    enmType;
    43     LONG64                  aMaxBytesPerSec;
    44     ULONG                   cReferences;
    45 };
    46 
    47 struct BandwidthGroup::Data
    48 {
    49     Data(BandwidthControl * const aBandwidthControl)
    50         : pParent(aBandwidthControl),
    51           pPeer(NULL)
    52     { }
    53 
    54     BandwidthControl * const    pParent;
    55     ComObjPtr<BandwidthGroup>   pPeer;
    56 
    57     // use the XML settings structure in the members for simplicity
    58     Backupable<BackupableBandwidthGroupData> bd;
    59 };
    60 
    6127// constructor / destructor
    6228/////////////////////////////////////////////////////////////////////////////
     29//
     30DEFINE_EMPTY_CTOR_DTOR(BandwidthGroup)
    6331
    6432HRESULT BandwidthGroup::FinalConstruct()
     
    228196}
    229197
    230 STDMETHODIMP BandwidthGroup::COMGETTER(Name)(BSTR *aName)
    231 {
    232     CheckComArgOutPointerValid(aName);
    233 
    234     AutoCaller autoCaller(this);
    235     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    236 
     198HRESULT BandwidthGroup::getName(com::Utf8Str &aName)
     199{
    237200    /* mName is constant during life time, no need to lock */
    238     m->bd.data()->strName.cloneTo(aName);
    239 
    240     return S_OK;
    241 }
    242 
    243 STDMETHODIMP BandwidthGroup::COMGETTER(Type)(BandwidthGroupType_T *aType)
    244 {
    245     CheckComArgOutPointerValid(aType);
    246 
    247     AutoCaller autoCaller(this);
    248     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    249 
     201    aName = m->bd.data()->strName;
     202
     203    return S_OK;
     204}
     205
     206HRESULT BandwidthGroup::getType(BandwidthGroupType_T *aType)
     207{
    250208    /* type is constant during life time, no need to lock */
    251209    *aType = m->bd->enmType;
     
    254212}
    255213
    256 STDMETHODIMP BandwidthGroup::COMGETTER(Reference)(ULONG *aReferences)
    257 {
    258     CheckComArgOutPointerValid(aReferences);
    259 
    260     AutoCaller autoCaller(this);
    261     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    262 
     214HRESULT BandwidthGroup::getReference(ULONG *aReferences)
     215{
    263216    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    264217
     
    268221}
    269222
    270 STDMETHODIMP BandwidthGroup::COMGETTER(MaxBytesPerSec)(LONG64 *aMaxBytesPerSec)
    271 {
    272     CheckComArgOutPointerValid(aMaxBytesPerSec);
    273 
    274     AutoCaller autoCaller(this);
    275     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    276 
     223HRESULT BandwidthGroup::getMaxBytesPerSec(LONG64 *aMaxBytesPerSec)
     224{
    277225    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    278226
     
    282230}
    283231
    284 STDMETHODIMP BandwidthGroup::COMSETTER(MaxBytesPerSec)(LONG64 aMaxBytesPerSec)
     232HRESULT BandwidthGroup::setMaxBytesPerSec(LONG64 aMaxBytesPerSec)
    285233{
    286234    if (aMaxBytesPerSec < 0)
     
    288236                        tr("Bandwidth group limit cannot be negative"));
    289237
    290     AutoCaller autoCaller(this);
    291     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    292 
    293238    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    294239
     
    297242
    298243    /* inform direct session if any. */
    299     ComObjPtr<Machine> pMachine = m->pParent->getMachine();
     244    ComObjPtr<Machine> pMachine = m->pParent->i_getMachine();
    300245    alock.release();
    301246    pMachine->onBandwidthGroupChange(this);
     
    308253
    309254/** @note Locks objects for writing! */
    310 void BandwidthGroup::rollback()
     255void BandwidthGroup::i_rollback()
    311256{
    312257    AutoCaller autoCaller(this);
     
    322267 *  for writing) if there is one.
    323268 */
    324 void BandwidthGroup::commit()
     269void BandwidthGroup::i_commit()
    325270{
    326271    /* sanity */
     
    355300 *  represented by @a aThat (locked for reading).
    356301 */
    357 void BandwidthGroup::unshare()
     302void BandwidthGroup::i_unshare()
    358303{
    359304    /* sanity */
     
    381326}
    382327
    383 ComObjPtr<BandwidthGroup> BandwidthGroup::getPeer()
    384 {
    385     return m->pPeer;
    386 }
    387 
    388 const Utf8Str& BandwidthGroup::getName() const
    389 {
    390     return m->bd->strName;
    391 }
    392 
    393 BandwidthGroupType_T BandwidthGroup::getType() const
    394 {
    395     return m->bd->enmType;
    396 }
    397 
    398 LONG64 BandwidthGroup::getMaxBytesPerSec() const
    399 {
    400     return m->bd->aMaxBytesPerSec;
    401 }
    402 
    403 ULONG BandwidthGroup::getReferences() const
    404 {
    405     return m->bd->cReferences;
    406 }
    407 
    408 void BandwidthGroup::reference()
     328void BandwidthGroup::i_reference()
    409329{
    410330    AutoWriteLock wl(this COMMA_LOCKVAL_SRC_POS);
     
    413333}
    414334
    415 void BandwidthGroup::release()
     335void BandwidthGroup::i_release()
    416336{
    417337    AutoWriteLock wl(this COMMA_LOCKVAL_SRC_POS);
  • trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp

    r49618 r49644  
    77
    88/*
    9  * Copyright (C) 2006-2011 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3838
    3939
    40 struct DHCPServer::Data
    41 {
    42     Data() : enabled(FALSE) {}
    43 
    44     Bstr IPAddress;
    45     Bstr lowerIP;
    46     Bstr upperIP;
    47 
    48     BOOL enabled;
    49     DHCPServerRunner dhcp;
    50 
    51     DhcpOptionMap GlobalDhcpOptions;
    52     VmSlot2OptionsMap VmSlot2Options;
    53 };
    54 
    55 
    5640DHCPServer::DHCPServer()
    57   : m(NULL), mVirtualBox(NULL)
    58 {
    59     m = new DHCPServer::Data();
     41    : mVirtualBox(NULL)
     42{
    6043}
    6144
     
    6346DHCPServer::~DHCPServer()
    6447{
    65     if (m)
    66     {
    67         delete m;
    68         m = NULL;
    69     }
    7048}
    7149
     
    10785
    10886    unconst(mName) = aName;
    109     m->IPAddress = "0.0.0.0";
    110     m->GlobalDhcpOptions.insert(DhcpOptValuePair(DhcpOpt_SubnetMask, Bstr("0.0.0.0")));
    111     m->enabled = FALSE;
    112 
    113     m->lowerIP = "0.0.0.0";
    114     m->upperIP = "0.0.0.0";
     87    m.IPAddress = "0.0.0.0";
     88    m.GlobalDhcpOptions.insert(DhcpOptValuePair(DhcpOpt_SubnetMask, Bstr("0.0.0.0")));
     89    m.enabled = FALSE;
     90
     91    m.lowerIP = "0.0.0.0";
     92    m.upperIP = "0.0.0.0";
    11593
    11694    /* Confirm a successful initialization */
     
    132110
    133111    unconst(mName) = data.strNetworkName;
    134     m->IPAddress = data.strIPAddress;
    135     m->enabled = data.fEnabled;
    136     m->lowerIP = data.strIPLower;
    137     m->upperIP = data.strIPUpper;
    138 
    139     m->GlobalDhcpOptions.clear();
    140     m->GlobalDhcpOptions.insert(data.GlobalDhcpOptions.begin(),
     112    m.IPAddress = data.strIPAddress;
     113    m.enabled = data.fEnabled;
     114    m.lowerIP = data.strIPLower;
     115    m.upperIP = data.strIPUpper;
     116
     117    m.GlobalDhcpOptions.clear();
     118    m.GlobalDhcpOptions.insert(data.GlobalDhcpOptions.begin(),
    141119                               data.GlobalDhcpOptions.end());
    142120
    143     m->VmSlot2Options.clear();
    144     m->VmSlot2Options.insert(data.VmSlot2OptionsM.begin(),
     121    m.VmSlot2Options.clear();
     122    m.VmSlot2Options.insert(data.VmSlot2OptionsM.begin(),
    145123                            data.VmSlot2OptionsM.end());
    146124
     
    151129
    152130
    153 HRESULT DHCPServer::saveSettings(settings::DHCPServer &data)
     131HRESULT DHCPServer::i_saveSettings(settings::DHCPServer &data)
    154132{
    155133    AutoCaller autoCaller(this);
     
    159137
    160138    data.strNetworkName = mName;
    161     data.strIPAddress = m->IPAddress;
    162 
    163     data.fEnabled = !!m->enabled;
    164     data.strIPLower = m->lowerIP;
    165     data.strIPUpper = m->upperIP;
     139    data.strIPAddress = m.IPAddress;
     140
     141    data.fEnabled = !!m.enabled;
     142    data.strIPLower = m.lowerIP;
     143    data.strIPUpper = m.upperIP;
    166144
    167145    data.GlobalDhcpOptions.clear();
    168     data.GlobalDhcpOptions.insert(m->GlobalDhcpOptions.begin(),
    169                                   m->GlobalDhcpOptions.end());
     146    data.GlobalDhcpOptions.insert(m.GlobalDhcpOptions.begin(),
     147                                  m.GlobalDhcpOptions.end());
    170148
    171149    data.VmSlot2OptionsM.clear();
    172     data.VmSlot2OptionsM.insert(m->VmSlot2Options.begin(),
    173                                 m->VmSlot2Options.end());
    174 
    175     return S_OK;
    176 }
    177 
    178 
    179 STDMETHODIMP DHCPServer::COMGETTER(NetworkName) (BSTR *aName)
    180 {
    181     CheckComArgOutPointerValid(aName);
    182 
    183     AutoCaller autoCaller(this);
    184     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    185 
    186     mName.cloneTo(aName);
    187 
    188     return S_OK;
    189 }
    190 
    191 
    192 STDMETHODIMP DHCPServer::COMGETTER(Enabled) (BOOL *aEnabled)
    193 {
    194     CheckComArgOutPointerValid(aEnabled);
    195 
    196     AutoCaller autoCaller(this);
    197     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    198 
    199     *aEnabled = m->enabled;
    200 
    201     return S_OK;
    202 }
    203 
    204 
    205 STDMETHODIMP DHCPServer::COMSETTER(Enabled) (BOOL aEnabled)
    206 {
    207     AutoCaller autoCaller(this);
    208     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    209 
     150    data.VmSlot2OptionsM.insert(m.VmSlot2Options.begin(),
     151                                m.VmSlot2Options.end());
     152
     153    return S_OK;
     154}
     155
     156
     157HRESULT DHCPServer::getNetworkName(com::Utf8Str &aName)
     158{
     159    aName = mName;
     160    return S_OK;
     161}
     162
     163
     164HRESULT DHCPServer::getEnabled(BOOL *aEnabled)
     165{
     166    *aEnabled = m.enabled;
     167
     168    return S_OK;
     169}
     170
     171
     172HRESULT DHCPServer::setEnabled(BOOL aEnabled)
     173{
    210174    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    211     m->enabled = aEnabled;
     175    m.enabled = aEnabled;
    212176
    213177    // save the global settings; for that we should hold only the VirtualBox lock
     
    220184
    221185
    222 STDMETHODIMP DHCPServer::COMGETTER(IPAddress) (BSTR *aIPAddress)
    223 {
    224     CheckComArgOutPointerValid(aIPAddress);
    225 
    226     AutoCaller autoCaller(this);
    227     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    228 
    229     m->IPAddress.cloneTo(aIPAddress);
    230 
    231     return S_OK;
    232 }
    233 
    234 
    235 STDMETHODIMP DHCPServer::COMGETTER(NetworkMask) (BSTR *aNetworkMask)
    236 {
    237     CheckComArgOutPointerValid(aNetworkMask);
    238 
    239     AutoCaller autoCaller(this);
    240     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    241 
    242     m->GlobalDhcpOptions[DhcpOpt_SubnetMask].cloneTo(aNetworkMask);
    243 
    244     return S_OK;
    245 }
    246 
    247 
    248 STDMETHODIMP DHCPServer::COMGETTER(LowerIP) (BSTR *aIPAddress)
    249 {
    250     CheckComArgOutPointerValid(aIPAddress);
    251 
    252     AutoCaller autoCaller(this);
    253     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    254 
    255     m->lowerIP.cloneTo(aIPAddress);
    256 
    257     return S_OK;
    258 }
    259 
    260 
    261 STDMETHODIMP DHCPServer::COMGETTER(UpperIP) (BSTR *aIPAddress)
    262 {
    263     CheckComArgOutPointerValid(aIPAddress);
    264 
    265     AutoCaller autoCaller(this);
    266     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    267 
    268     m->upperIP.cloneTo(aIPAddress);
    269 
    270     return S_OK;
    271 }
    272 
    273 
    274 STDMETHODIMP DHCPServer::SetConfiguration (IN_BSTR aIPAddress, IN_BSTR aNetworkMask, IN_BSTR aLowerIP, IN_BSTR aUpperIP)
    275 {
    276     AssertReturn(aIPAddress != NULL, E_INVALIDARG);
    277     AssertReturn(aNetworkMask != NULL, E_INVALIDARG);
    278     AssertReturn(aLowerIP != NULL, E_INVALIDARG);
    279     AssertReturn(aUpperIP != NULL, E_INVALIDARG);
    280 
    281     AutoCaller autoCaller(this);
    282     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     186HRESULT DHCPServer::getIPAddress(com::Utf8Str &aIPAddress)
     187{
     188    aIPAddress = Utf8Str(m.IPAddress);
     189
     190    return S_OK;
     191}
     192
     193
     194HRESULT DHCPServer::getNetworkMask(com::Utf8Str &aNetworkMask)
     195{
     196    aNetworkMask = m.GlobalDhcpOptions[DhcpOpt_SubnetMask];
     197
     198    return S_OK;
     199}
     200
     201
     202HRESULT DHCPServer::getLowerIP(com::Utf8Str &aIPAddress)
     203{
     204    aIPAddress = Utf8Str(m.lowerIP);
     205
     206    return S_OK;
     207}
     208
     209
     210HRESULT DHCPServer::getUpperIP(com::Utf8Str &aIPAddress)
     211{
     212    aIPAddress = Utf8Str(m.upperIP);
     213
     214    return S_OK;
     215}
     216
     217
     218HRESULT DHCPServer::setConfiguration(const com::Utf8Str &aIPAddress,
     219                                     const com::Utf8Str &aNetworkMask,
     220                                     const com::Utf8Str &aLowerIP,
     221                                     const com::Utf8Str &aUpperIP)
     222{
     223    AssertReturn(!aIPAddress.isEmpty(), E_INVALIDARG);
     224    AssertReturn(!aNetworkMask.isEmpty(), E_INVALIDARG);
     225    AssertReturn(!aLowerIP.isEmpty(), E_INVALIDARG);
     226    AssertReturn(!aUpperIP.isEmpty(), E_INVALIDARG);
    283227
    284228    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    285     m->IPAddress = aIPAddress;
    286     m->GlobalDhcpOptions[DhcpOpt_SubnetMask] = aNetworkMask;
    287 
    288     m->lowerIP = aLowerIP;
    289     m->upperIP = aUpperIP;
     229    m.IPAddress = aIPAddress;
     230    m.GlobalDhcpOptions[DhcpOpt_SubnetMask] = aNetworkMask;
     231
     232    m.lowerIP = aLowerIP;
     233    m.upperIP = aUpperIP;
    290234
    291235    // save the global settings; for that we should hold only the VirtualBox lock
     
    296240
    297241
    298 STDMETHODIMP DHCPServer::AddGlobalOption(DhcpOpt_T aOption, IN_BSTR aValue)
    299 {
    300     CheckComArgStr(aValue);
    301     /* store global option */
    302     AutoCaller autoCaller(this);
    303     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    304 
     242HRESULT DHCPServer::addGlobalOption(DhcpOpt_T aOption, const com::Utf8Str &aValue)
     243{
    305244    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    306245
    307     m->GlobalDhcpOptions.insert(
    308       DhcpOptValuePair(aOption, Utf8Str(aValue)));
    309 
    310     /* Indirect way to understand that we're on NAT network */
    311     if (aOption == DhcpOpt_Router)
    312         m->dhcp.setOption(NetworkServiceRunner::kNsrKeyNeedMain, "on");
    313 
     246    m.GlobalDhcpOptions.insert(DhcpOptValuePair(aOption, aValue));
    314247    alock.release();
    315248
     
    319252
    320253
    321 STDMETHODIMP DHCPServer::COMGETTER(GlobalOptions)(ComSafeArrayOut(BSTR, aValue))
    322 {
    323     CheckComArgOutSafeArrayPointerValid(aValue);
    324 
    325     AutoCaller autoCaller(this);
    326     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    327 
     254HRESULT DHCPServer::getGlobalOptions(std::vector<com::Utf8Str> &aValue)
     255{
    328256    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    329 
    330     SafeArray<BSTR> sf(m->GlobalDhcpOptions.size());
    331     int i = 0;
    332 
    333     for (DhcpOptIterator it = m->GlobalDhcpOptions.begin();
    334          it != m->GlobalDhcpOptions.end(); ++it)
     257    aValue.resize(m.GlobalDhcpOptions.size());
     258    DhcpOptionMap::const_iterator it;
     259    size_t i = 0;
     260    for (it = m.GlobalDhcpOptions.begin(); it != m.GlobalDhcpOptions.end(); ++it, ++i)
    335261    {
    336         Bstr(Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str())).detachTo(&sf[i]);
    337         i++;
     262        aValue[i] = Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str());
    338263    }
    339264
    340     sf.detachTo(ComSafeArrayOutArg(aValue));
    341 
    342     return S_OK;
    343 }
    344 
    345 
    346 STDMETHODIMP DHCPServer::COMGETTER(VmConfigs)(ComSafeArrayOut(BSTR, aValue))
    347 {
    348     CheckComArgOutSafeArrayPointerValid(aValue);
    349 
    350     AutoCaller autoCaller(this);
    351     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    352 
     265    return S_OK;
     266}
     267
     268HRESULT DHCPServer::getVmConfigs(std::vector<com::Utf8Str> &aValue)
     269{
    353270    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    354 
    355     SafeArray<BSTR> sf(m->VmSlot2Options.size());
    356     VmSlot2OptionsIterator it = m->VmSlot2Options.begin();
    357     int i = 0;
    358     for (;it != m->VmSlot2Options.end(); ++it)
     271    aValue.resize(m.VmSlot2Options.size());
     272    VmSlot2OptionsMap::const_iterator it;
     273    size_t i = 0;
     274    for (it = m.VmSlot2Options.begin(); it != m.VmSlot2Options.end(); ++it, ++i)
    359275    {
    360         Bstr(Utf8StrFmt("[%s]:%d",
    361                         it->first.VmName.c_str(),
    362                         it->first.Slot)).detachTo(&sf[i]);
    363         i++;
     276        aValue[i] = Utf8StrFmt("[%s]:%d", it->first.VmName.c_str(), it->first.Slot);
    364277    }
    365278
    366     sf.detachTo(ComSafeArrayOutArg(aValue));
    367 
    368     return S_OK;
    369 }
    370 
    371 
    372 STDMETHODIMP DHCPServer::AddVmSlotOption(IN_BSTR aVmName, LONG aSlot, DhcpOpt_T aOption, IN_BSTR aValue)
    373 {
    374     AutoCaller autoCaller(this);
    375     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     279    return S_OK;
     280}
     281
     282
     283HRESULT DHCPServer::addVmSlotOption(const com::Utf8Str &aVmName,
     284                                    LONG aSlot,
     285                                    DhcpOpt_T aOption,
     286                                    const com::Utf8Str &aValue)
     287{
    376288    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    377 
    378     m->VmSlot2Options[settings::VmNameSlotKey(
    379           com::Utf8Str(aVmName),
    380           aSlot)][aOption] = com::Utf8Str(aValue);
    381 
    382 
     289    m.VmSlot2Options[settings::VmNameSlotKey(aVmName, aSlot)][aOption] = aValue;
    383290    alock.release();
    384291
     
    388295
    389296
    390 STDMETHODIMP DHCPServer::RemoveVmSlotOptions(IN_BSTR aVmName, LONG aSlot)
    391 {
    392     AutoCaller autoCaller(this);
    393     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     297HRESULT DHCPServer::removeVmSlotOptions(const com::Utf8Str &aVmName, LONG aSlot)
     298{
    394299    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    395 
    396     DhcpOptionMap& map = findOptMapByVmNameSlot(com::Utf8Str(aVmName), aSlot);
    397 
     300    DhcpOptionMap& map = i_findOptMapByVmNameSlot(aVmName, aSlot);
    398301    map.clear();
    399302
     
    403306    return mVirtualBox->saveSettings();
    404307}
    405 
    406308
    407309/**
    408310 * this is mapping (vm, slot)
    409311 */
    410 STDMETHODIMP DHCPServer::GetVmSlotOptions(IN_BSTR aVmName,
    411                                           LONG aSlot,
    412                                           ComSafeArrayOut(BSTR, aValues))
    413 {
    414     CheckComArgOutSafeArrayPointerValid(aValues);
    415     AutoCaller autoCaller(this);
    416     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     312HRESULT DHCPServer::getVmSlotOptions(const com::Utf8Str &aVmName,
     313                                     LONG aSlot,
     314                                     std::vector<com::Utf8Str> &aValues)
     315{
    417316
    418317    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    419 
    420     DhcpOptionMap& map = findOptMapByVmNameSlot(com::Utf8Str(aVmName), aSlot);
    421 
    422     SafeArray<BSTR> sf(map.size());
    423     int i = 0;
    424 
    425     for (DhcpOptIterator it = map.begin();
    426          it != map.end(); ++it)
     318    DhcpOptionMap& map = i_findOptMapByVmNameSlot(aVmName, aSlot);
     319    aValues.resize(map.size());
     320    size_t i = 0;
     321    DhcpOptionMap::const_iterator it;
     322    for (it = map.begin(); it != map.end(); ++it, ++i)
    427323    {
    428         Bstr(Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str())).detachTo(&sf[i]);
    429         i++;
     324        aValues[i] = com::Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str());
    430325    }
    431326
    432     sf.detachTo(ComSafeArrayOutArg(aValues));
    433 
    434     return S_OK;
    435 }
    436 
    437 
    438 STDMETHODIMP DHCPServer::GetMacOptions(IN_BSTR aMAC, ComSafeArrayOut(BSTR, aValues))
    439 {
    440     CheckComArgOutSafeArrayPointerValid(aValues);
    441 
    442     AutoCaller autoCaller(this);
    443     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    444 
     327    return S_OK;
     328}
     329
     330
     331HRESULT DHCPServer::getMacOptions(const com::Utf8Str &aMAC, std::vector<com::Utf8Str> &aOption)
     332{
    445333    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    446334    HRESULT hrc = S_OK;
    447 
    448335    ComPtr<IMachine> machine;
    449336    ComPtr<INetworkAdapter> nic;
    450 
    451337    VmSlot2OptionsIterator it;
    452     for(it = m->VmSlot2Options.begin();
    453         it != m->VmSlot2Options.end();
    454         ++it)
     338    for(it = m.VmSlot2Options.begin(); it != m.VmSlot2Options.end(); ++it)
    455339    {
    456 
    457340        alock.release();
    458341        hrc = mVirtualBox->FindMachine(Bstr(it->first.VmName).raw(), machine.asOutParam());
     
    477360        if (FAILED(hrc)) /* no MAC address ??? */
    478361            break;
    479 
    480         if (!RTStrICmp(com::Utf8Str(mac).c_str(), com::Utf8Str(aMAC).c_str()))
    481             return GetVmSlotOptions(Bstr(it->first.VmName).raw(),
     362        if (!RTStrICmp(com::Utf8Str(mac).c_str(), aMAC.c_str()))
     363            return getVmSlotOptions(it->first.VmName,
    482364                                    it->first.Slot,
    483                                     ComSafeArrayOutArg(aValues));
     365                                    aOption);
    484366    } /* end of for */
    485367
     
    487369}
    488370
    489 
    490 STDMETHODIMP DHCPServer::COMGETTER(EventSource)(IEventSource **aEventSource)
     371HRESULT DHCPServer::getEventSource(ComPtr<IEventSource> &aEventSource)
    491372{
    492373    NOREF(aEventSource);
     
    495376
    496377
    497 STDMETHODIMP DHCPServer::Start(IN_BSTR aNetworkName, IN_BSTR aTrunkName, IN_BSTR aTrunkType)
     378HRESULT DHCPServer::start(const com::Utf8Str &aNetworkName,
     379                          const com::Utf8Str &aTrunkName,
     380                          const com::Utf8Str &aTrunkType)
    498381{
    499382    /* Silently ignore attempts to run disabled servers. */
    500     if (!m->enabled)
     383    if (!m.enabled)
    501384        return S_OK;
    502385
    503386    /* Commmon Network Settings */
    504     m->dhcp.setOption(NetworkServiceRunner::kNsrKeyNetwork, Utf8Str(aNetworkName).c_str());
    505 
    506     Bstr tmp(aTrunkName);
    507 
    508     if (!tmp.isEmpty())
    509         m->dhcp.setOption(NetworkServiceRunner::kNsrTrunkName, Utf8Str(tmp).c_str());
    510     m->dhcp.setOption(NetworkServiceRunner::kNsrKeyTrunkType, Utf8Str(aTrunkType).c_str());
     387    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyNetwork, aNetworkName.c_str());
     388
     389    if (!aTrunkName.isEmpty())
     390        m.dhcp.setOption(NetworkServiceRunner::kNsrTrunkName, aTrunkName.c_str());
     391
     392    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyTrunkType, aTrunkType.c_str());
    511393
    512394    /* XXX: should this MAC default initialization moved to NetworkServiceRunner? */
     
    518400                 guid.raw()->au8[1],
    519401                 guid.raw()->au8[2]);
    520     m->dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
    521     m->dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m->IPAddress).c_str());
    522     m->dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m->GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
    523     m->dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m->lowerIP).c_str());
    524     m->dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m->upperIP).c_str());
     402    m.dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
     403    m.dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m.IPAddress).c_str());
     404    m.dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m.GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
     405    m.dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m.lowerIP).c_str());
     406    m.dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m.upperIP).c_str());
    525407
    526408    /* XXX: This parameters Dhcp Server will fetch via API */
    527     return RT_FAILURE(m->dhcp.start()) ? E_FAIL : S_OK;
    528     //m->dhcp.detachFromServer(); /* need to do this to avoid server shutdown on runner destruction */
    529 }
    530 
    531 
    532 STDMETHODIMP DHCPServer::Stop (void)
    533 {
    534     return RT_FAILURE(m->dhcp.stop()) ? E_FAIL : S_OK;
    535 }
    536 
    537 
    538 DhcpOptionMap& DHCPServer::findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
     409    return RT_FAILURE(m.dhcp.start()) ? E_FAIL : S_OK;
     410    //m.dhcp.detachFromServer(); /* need to do this to avoid server shutdown on runner destruction */
     411}
     412
     413
     414HRESULT DHCPServer::stop (void)
     415{
     416    return RT_FAILURE(m.dhcp.stop()) ? E_FAIL : S_OK;
     417}
     418
     419
     420DhcpOptionMap& DHCPServer::i_findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
    539421                                                  LONG aSlot)
    540422{
    541     return m->VmSlot2Options[settings::VmNameSlotKey(
    542           com::Utf8Str(aVmName),
    543           aSlot)];
    544 }
     423    return m.VmSlot2Options[settings::VmNameSlotKey(aVmName, aSlot)];
     424}
  • trunk/src/VBox/Main/src-server/GuestOSTypeImpl.cpp

    r49074 r49644  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    147147/////////////////////////////////////////////////////////////////////////////
    148148
    149 STDMETHODIMP GuestOSType::COMGETTER(FamilyId)(BSTR *aFamilyId)
    150 {
    151     CheckComArgOutPointerValid(aFamilyId);
    152 
    153     AutoCaller autoCaller(this);
    154     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    155 
     149HRESULT GuestOSType::getFamilyId(com::Utf8Str &aFamilyId)
     150{
    156151    /* mFamilyID is constant during life time, no need to lock */
    157     mFamilyID.cloneTo(aFamilyId);
    158 
    159     return S_OK;
    160 }
    161 
    162 STDMETHODIMP GuestOSType::COMGETTER(FamilyDescription)(BSTR *aFamilyDescription)
    163 {
    164     CheckComArgOutPointerValid(aFamilyDescription);
    165 
    166     AutoCaller autoCaller(this);
    167     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    168 
     152    aFamilyId = mFamilyID;
     153    return S_OK;
     154}
     155
     156
     157HRESULT GuestOSType::getFamilyDescription(com::Utf8Str &aFamilyDescription)
     158{
    169159    /* mFamilyDescription is constant during life time, no need to lock */
    170     mFamilyDescription.cloneTo(aFamilyDescription);
    171 
    172     return S_OK;
    173 }
    174 
    175 STDMETHODIMP GuestOSType::COMGETTER(Id)(BSTR *aId)
    176 {
    177     CheckComArgOutPointerValid(aId);
    178 
    179     AutoCaller autoCaller(this);
    180     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    181 
     160    aFamilyDescription = mFamilyDescription;
     161
     162    return S_OK;
     163}
     164
     165
     166HRESULT GuestOSType::getId(com::Utf8Str &aId)
     167{
    182168    /* mID is constant during life time, no need to lock */
    183     mID.cloneTo(aId);
    184 
    185     return S_OK;
    186 }
    187 
    188 STDMETHODIMP GuestOSType::COMGETTER(Description)(BSTR *aDescription)
    189 {
    190     CheckComArgOutPointerValid(aDescription);
    191 
    192     AutoCaller autoCaller(this);
    193     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    194 
     169    aId = mID;
     170
     171    return S_OK;
     172}
     173
     174
     175HRESULT GuestOSType::getDescription(com::Utf8Str &aDescription)
     176{
    195177    /* mDescription is constant during life time, no need to lock */
    196     mDescription.cloneTo(aDescription);
    197 
    198     return S_OK;
    199 }
    200 
    201 STDMETHODIMP GuestOSType::COMGETTER(Is64Bit)(BOOL *aIs64Bit)
    202 {
    203     CheckComArgOutPointerValid(aIs64Bit);
    204 
    205     AutoCaller autoCaller(this);
    206     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    207 
     178    aDescription = mDescription;
     179
     180    return S_OK;
     181}
     182
     183HRESULT GuestOSType::getIs64Bit(BOOL *aIs64Bit)
     184{
    208185    /* mIs64Bit is constant during life time, no need to lock */
    209186    *aIs64Bit = !!(mOSHint & VBOXOSHINT_64BIT);
     
    212189}
    213190
    214 STDMETHODIMP GuestOSType::COMGETTER(RecommendedIOAPIC)(BOOL *aRecommendedIOAPIC)
    215 {
    216     CheckComArgOutPointerValid(aRecommendedIOAPIC);
    217 
    218     AutoCaller autoCaller(this);
    219     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    220 
     191HRESULT GuestOSType::getRecommendedIOAPIC(BOOL *aRecommendedIOAPIC)
     192{
    221193    /* mRecommendedIOAPIC is constant during life time, no need to lock */
    222194    *aRecommendedIOAPIC = !!(mOSHint & VBOXOSHINT_IOAPIC);
     
    225197}
    226198
    227 STDMETHODIMP GuestOSType::COMGETTER(RecommendedVirtEx)(BOOL *aRecommendedVirtEx)
    228 {
    229     CheckComArgOutPointerValid(aRecommendedVirtEx);
    230 
    231     AutoCaller autoCaller(this);
    232     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    233 
     199
     200HRESULT GuestOSType::getRecommendedVirtEx(BOOL *aRecommendedVirtEx)
     201{
    234202    /* mRecommendedVirtEx is constant during life time, no need to lock */
    235203    *aRecommendedVirtEx = !!(mOSHint & VBOXOSHINT_HWVIRTEX);
     
    238206}
    239207
    240 STDMETHODIMP GuestOSType::COMGETTER(RecommendedRAM)(ULONG *aRAMSize)
    241 {
    242     CheckComArgOutPointerValid(aRAMSize);
    243 
    244     AutoCaller autoCaller(this);
    245     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    246 
     208
     209HRESULT GuestOSType::getRecommendedRAM(ULONG *aRAMSize)
     210{
    247211    /* mRAMSize is constant during life time, no need to lock */
    248212    *aRAMSize = mRAMSize;
     
    251215}
    252216
    253 STDMETHODIMP GuestOSType::COMGETTER(RecommendedVRAM)(ULONG *aVRAMSize)
    254 {
    255     CheckComArgOutPointerValid(aVRAMSize);
    256 
    257     AutoCaller autoCaller(this);
    258     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    259 
     217
     218HRESULT GuestOSType::getRecommendedVRAM(ULONG *aVRAMSize)
     219{
    260220    /* mVRAMSize is constant during life time, no need to lock */
    261221    *aVRAMSize = mVRAMSize;
     
    264224}
    265225
    266 STDMETHODIMP GuestOSType::COMGETTER(Recommended2DVideoAcceleration)(BOOL *aRecommended2DVideoAcceleration)
    267 {
    268     CheckComArgOutPointerValid(aRecommended2DVideoAcceleration);
    269 
    270     AutoCaller autoCaller(this);
    271     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    272 
     226
     227HRESULT GuestOSType::getRecommended2DVideoAcceleration(BOOL *aRecommended2DVideoAcceleration)
     228{
    273229    /* Constant during life time, no need to lock */
    274230    *aRecommended2DVideoAcceleration = !!(mOSHint & VBOXOSHINT_ACCEL2D);
     
    277233}
    278234
    279 STDMETHODIMP GuestOSType::COMGETTER(Recommended3DAcceleration)(BOOL *aRecommended3DAcceleration)
    280 {
    281     CheckComArgOutPointerValid(aRecommended3DAcceleration);
    282 
    283     AutoCaller autoCaller(this);
    284     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    285 
     235
     236HRESULT GuestOSType::getRecommended3DAcceleration(BOOL *aRecommended3DAcceleration)
     237{
    286238    /* Constant during life time, no need to lock */
    287239    *aRecommended3DAcceleration = !!(mOSHint & VBOXOSHINT_ACCEL3D);
     
    290242}
    291243
    292 STDMETHODIMP GuestOSType::COMGETTER(RecommendedHDD)(LONG64 *aHDDSize)
    293 {
    294     CheckComArgOutPointerValid(aHDDSize);
    295 
    296     AutoCaller autoCaller(this);
    297     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    298 
     244
     245HRESULT GuestOSType::getRecommendedHDD(LONG64 *aHDDSize)
     246{
    299247    /* mHDDSize is constant during life time, no need to lock */
    300248    *aHDDSize = mHDDSize;
     
    303251}
    304252
    305 STDMETHODIMP GuestOSType::COMGETTER(AdapterType)(NetworkAdapterType_T *aNetworkAdapterType)
    306 {
    307     CheckComArgOutPointerValid(aNetworkAdapterType);
    308 
    309     AutoCaller autoCaller(this);
    310     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    311 
     253
     254HRESULT GuestOSType::getAdapterType(NetworkAdapterType_T *aNetworkAdapterType)
     255{
    312256    /* mNetworkAdapterType is constant during life time, no need to lock */
    313257    *aNetworkAdapterType = mNetworkAdapterType;
     
    316260}
    317261
    318 STDMETHODIMP GuestOSType::COMGETTER(RecommendedPAE)(BOOL *aRecommendedPAE)
    319 {
    320     CheckComArgOutPointerValid(aRecommendedPAE);
    321 
    322     AutoCaller autoCaller(this);
    323     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    324 
     262HRESULT GuestOSType::getRecommendedPAE(BOOL *aRecommendedPAE)
     263{
    325264    /* recommended PAE is constant during life time, no need to lock */
    326265    *aRecommendedPAE = !!(mOSHint & VBOXOSHINT_PAE);
     
    329268}
    330269
    331 STDMETHODIMP GuestOSType::COMGETTER(RecommendedFirmware)(FirmwareType_T *aFirmwareType)
    332 {
    333     CheckComArgOutPointerValid(aFirmwareType);
    334 
    335     AutoCaller autoCaller(this);
    336     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    337 
     270
     271HRESULT GuestOSType::getRecommendedFirmware(FirmwareType_T *aFirmwareType)
     272{
    338273    /* firmware type is constant during life time, no need to lock */
    339274    if (mOSHint & VBOXOSHINT_EFI)
     
    345280}
    346281
    347 STDMETHODIMP GuestOSType::COMGETTER(RecommendedDVDStorageController)(StorageControllerType_T * aStorageControllerType)
    348 {
    349     CheckComArgOutPointerValid(aStorageControllerType);
    350 
    351     AutoCaller autoCaller(this);
    352     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    353 
     282
     283HRESULT GuestOSType::getRecommendedDVDStorageController(StorageControllerType_T *aStorageControllerType)
     284{
    354285    /* storage controller type is constant during life time, no need to lock */
    355286    *aStorageControllerType = mDVDStorageControllerType;
     
    358289}
    359290
    360 STDMETHODIMP GuestOSType::COMGETTER(RecommendedDVDStorageBus)(StorageBus_T * aStorageBusType)
    361 {
    362     CheckComArgOutPointerValid(aStorageBusType);
    363 
    364     AutoCaller autoCaller(this);
    365     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    366 
     291
     292HRESULT GuestOSType::getRecommendedDVDStorageBus(StorageBus_T *aStorageBusType)
     293{
    367294    /* storage controller type is constant during life time, no need to lock */
    368295    *aStorageBusType = mDVDStorageBusType;
     
    371298}
    372299
    373 STDMETHODIMP GuestOSType::COMGETTER(RecommendedHDStorageController)(StorageControllerType_T * aStorageControllerType)
    374 {
    375     CheckComArgOutPointerValid(aStorageControllerType);
    376 
    377     AutoCaller autoCaller(this);
    378     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    379 
     300
     301HRESULT GuestOSType::getRecommendedHDStorageController(StorageControllerType_T *aStorageControllerType)
     302{
    380303    /* storage controller type is constant during life time, no need to lock */
    381304    *aStorageControllerType = mHDStorageControllerType;
     
    384307}
    385308
    386 STDMETHODIMP GuestOSType::COMGETTER(RecommendedHDStorageBus)(StorageBus_T * aStorageBusType)
    387 {
    388     CheckComArgOutPointerValid(aStorageBusType);
    389 
    390     AutoCaller autoCaller(this);
    391     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    392 
     309
     310HRESULT GuestOSType::getRecommendedHDStorageBus(StorageBus_T *aStorageBusType)
     311{
    393312    /* storage controller type is constant during life time, no need to lock */
    394313    *aStorageBusType = mHDStorageBusType;
     
    397316}
    398317
    399 STDMETHODIMP GuestOSType::COMGETTER(RecommendedUSBHID)(BOOL *aRecommendedUSBHID)
    400 {
    401     CheckComArgOutPointerValid(aRecommendedUSBHID);
    402 
    403     AutoCaller autoCaller(this);
    404     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    405 
     318
     319HRESULT GuestOSType::getRecommendedUSBHID(BOOL *aRecommendedUSBHID)
     320{
    406321    /* HID type is constant during life time, no need to lock */
    407322    *aRecommendedUSBHID = !!(mOSHint & VBOXOSHINT_USBHID);
     
    410325}
    411326
    412 STDMETHODIMP GuestOSType::COMGETTER(RecommendedHPET)(BOOL *aRecommendedHPET)
    413 {
    414     CheckComArgOutPointerValid(aRecommendedHPET);
    415 
    416     AutoCaller autoCaller(this);
    417     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    418 
     327
     328HRESULT GuestOSType::getRecommendedHPET(BOOL *aRecommendedHPET)
     329{
    419330    /* HPET recommendation is constant during life time, no need to lock */
    420331    *aRecommendedHPET = !!(mOSHint & VBOXOSHINT_HPET);
     
    423334}
    424335
    425 STDMETHODIMP GuestOSType::COMGETTER(RecommendedUSBTablet)(BOOL *aRecommendedUSBTablet)
    426 {
    427     CheckComArgOutPointerValid(aRecommendedUSBTablet);
    428 
    429     AutoCaller autoCaller(this);
    430     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    431 
     336
     337HRESULT GuestOSType::getRecommendedUSBTablet(BOOL *aRecommendedUSBTablet)
     338{
    432339    /* HID type is constant during life time, no need to lock */
    433340    *aRecommendedUSBTablet = !!(mOSHint & VBOXOSHINT_USBTABLET);
     
    436343}
    437344
    438 STDMETHODIMP GuestOSType::COMGETTER(RecommendedRTCUseUTC)(BOOL *aRecommendedRTCUseUTC)
    439 {
    440     CheckComArgOutPointerValid(aRecommendedRTCUseUTC);
    441 
    442     AutoCaller autoCaller(this);
    443     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    444 
     345
     346HRESULT GuestOSType::getRecommendedRTCUseUTC(BOOL *aRecommendedRTCUseUTC)
     347{
    445348    /* Value is constant during life time, no need to lock */
    446349    *aRecommendedRTCUseUTC = !!(mOSHint & VBOXOSHINT_RTCUTC);
     
    449352}
    450353
    451 STDMETHODIMP GuestOSType::COMGETTER(RecommendedChipset) (ChipsetType_T *aChipsetType)
    452 {
    453     CheckComArgOutPointerValid(aChipsetType);
    454 
    455     AutoCaller autoCaller(this);
    456     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    457 
     354
     355HRESULT GuestOSType::getRecommendedChipset(ChipsetType_T *aChipsetType)
     356{
    458357    /* chipset type is constant during life time, no need to lock */
    459358    *aChipsetType = mChipsetType;
     
    462361}
    463362
    464 STDMETHODIMP GuestOSType::COMGETTER(RecommendedAudioController) (AudioControllerType_T *aAudioController)
    465 {
    466     CheckComArgOutPointerValid(aAudioController);
    467 
    468     AutoCaller autoCaller(this);
    469     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    470 
     363
     364HRESULT GuestOSType::getRecommendedAudioController(AudioControllerType_T *aAudioController)
     365{
    471366    *aAudioController = mAudioControllerType;
    472367
     
    474369}
    475370
    476 STDMETHODIMP GuestOSType::COMGETTER(RecommendedFloppy)(BOOL *aRecommendedFloppy)
    477 {
    478     CheckComArgOutPointerValid(aRecommendedFloppy);
    479 
    480     AutoCaller autoCaller(this);
    481     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    482 
     371
     372HRESULT GuestOSType::getRecommendedFloppy(BOOL *aRecommendedFloppy)
     373{
    483374    /* Value is constant during life time, no need to lock */
    484375    *aRecommendedFloppy = !!(mOSHint & VBOXOSHINT_FLOPPY);
     
    487378}
    488379
    489 STDMETHODIMP GuestOSType::COMGETTER(RecommendedUSB)(BOOL *aRecommendedUSB)
    490 {
    491     CheckComArgOutPointerValid(aRecommendedUSB);
    492 
    493     AutoCaller autoCaller(this);
    494     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    495 
     380
     381HRESULT GuestOSType::getRecommendedUSB(BOOL *aRecommendedUSB)
     382{
    496383    /* Value is constant during life time, no need to lock */
    497384    *aRecommendedUSB = !(mOSHint & VBOXOSHINT_NOUSB);
     
    500387}
    501388
    502 STDMETHODIMP GuestOSType::COMGETTER(RecommendedTFReset)(BOOL *aRecommendedTFReset)
    503 {
    504     CheckComArgOutPointerValid(aRecommendedTFReset);
    505 
    506     AutoCaller autoCaller(this);
    507     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    508 
     389HRESULT GuestOSType::getRecommendedTFReset(BOOL *aRecommendedTFReset)
     390{
    509391    /* recommended triple fault behavior is constant during life time, no need to lock */
    510392    *aRecommendedTFReset = !!(mOSHint & VBOXOSHINT_TFRESET);
     
    512394    return S_OK;
    513395}
    514 
    515396/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r49552 r49644  
    337337        {
    338338            /* Store OS type */
    339             mUserData->s.strOsType = aOsType->id();
     339            mUserData->s.strOsType = aOsType->i_id();
    340340
    341341            /* Apply BIOS defaults */
     
    348348            /* Apply serial port defaults */
    349349            for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); ++slot)
    350                 mSerialPorts[slot]->applyDefaults(aOsType);
     350                mSerialPorts[slot]->i_applyDefaults(aOsType);
    351351
    352352            /* Let the OS type select 64-bit ness. */
    353             mHWData->mLongMode = aOsType->is64Bit()
     353            mHWData->mLongMode = aOsType->i_is64Bit()
    354354                               ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;
    355355        }
     
    40704070
    40714071    // check that the port and device are not out of range
    4072     rc = ctl->checkPortAndDeviceValid(aControllerPort, aDevice);
     4072    rc = ctl->i_checkPortAndDeviceValid(aControllerPort, aDevice);
    40734073    if (FAILED(rc)) return rc;
    40744074
     
    49744974        Assert(SUCCEEDED(rc));
    49754975
    4976         pBandwidthGroupOld->release();
     4976        pBandwidthGroupOld->i_release();
    49774977        pAttach->updateBandwidthGroup(Utf8Str::Empty);
    49784978    }
     
    49804980    if (!group.isNull())
    49814981    {
    4982         group->reference();
    4983         pAttach->updateBandwidthGroup(group->getName());
     4982        group->i_reference();
     4983        pAttach->updateBandwidthGroup(group->i_getName());
    49844984    }
    49854985
     
    64486448         ++it)
    64496449    {
    6450         if ((*it)->getStorageBus() == aConnectionType)
    6451         {
    6452             ULONG ulCurInst = (*it)->getInstance();
     6450        if ((*it)->i_getStorageBus() == aConnectionType)
     6451        {
     6452            ULONG ulCurInst = (*it)->i_getInstance();
    64536453
    64546454            if (ulCurInst >= ulInstance)
     
    64566456
    64576457            /* Only one controller of each type can be marked as bootable. */
    6458             if ((*it)->getBootable())
     6458            if ((*it)->i_getBootable())
    64596459                fBootable = false;
    64606460        }
     
    65086508         ++it)
    65096509    {
    6510         if ((*it)->getInstance() == aInstance)
     6510        if ((*it)->i_getInstance() == aInstance)
    65116511        {
    65126512            (*it).queryInterfaceTo(aStorageController);
     
    65446544                ComObjPtr<StorageController> aCtrl = (*it);
    65456545
    6546                 if (   (aCtrl->getName() != Utf8Str(aName))
    6547                     && aCtrl->getBootable() == TRUE
    6548                     && aCtrl->getStorageBus() == ctrl->getStorageBus()
    6549                     && aCtrl->getControllerType() == ctrl->getControllerType())
     6546                if (   (aCtrl->i_getName() != Utf8Str(aName))
     6547                    && aCtrl->i_getBootable() == TRUE
     6548                    && aCtrl->i_getStorageBus() == ctrl->i_getStorageBus()
     6549                    && aCtrl->i_getControllerType() == ctrl->i_getControllerType())
    65506550                {
    6551                     aCtrl->setBootable(FALSE);
     6551                    aCtrl->i_setBootable(FALSE);
    65526552                    break;
    65536553                }
     
    65576557        if (SUCCEEDED(rc))
    65586558        {
    6559             ctrl->setBootable(fBootable);
     6559            ctrl->i_setBootable(fBootable);
    65606560            setModified(IsModified_Storage);
    65616561        }
     
    66176617    mStorageControllers.backup();
    66186618
    6619     ctrl->unshare();
     6619    ctrl->i_unshare();
    66206620
    66216621    mStorageControllers->remove(ctrl);
     
    86838683
    86848684    /* initialize mOSTypeId */
    8685     mUserData->s.strOsType = mParent->getUnknownOSType()->id();
     8685    mUserData->s.strOsType = mParent->getUnknownOSType()->i_id();
    86868686
    86878687    /* create associated BIOS settings object */
     
    93519351
    93529352        /* VRDEServer */
    9353         rc = mVRDEServer->loadSettings(data.vrdeSettings);
     9353        rc = mVRDEServer->i_loadSettings(data.vrdeSettings);
    93549354        if (FAILED(rc)) return rc;
    93559355
     
    93599359
    93609360        // Bandwidth control (must come before network adapters)
    9361         rc = mBandwidthControl->loadSettings(data.ioSettings);
     9361        rc = mBandwidthControl->i_loadSettings(data.ioSettings);
    93629362        if (FAILED(rc)) return rc;
    93639363
     
    94139413
    94149414            AssertBreak(s.ulSlot < RT_ELEMENTS(mSerialPorts));
    9415             rc = mSerialPorts[s.ulSlot]->loadSettings(s);
     9415            rc = mSerialPorts[s.ulSlot]->i_loadSettings(s);
    94169416            if (FAILED(rc)) return rc;
    94179417        }
     
    95919591        if (ctlData.controllerType == StorageControllerType_IntelAhci)
    95929592        {
    9593             if (    (FAILED(rc = pCtl->setIDEEmulationPort(0, ctlData.lIDE0MasterEmulationPort)))
    9594                  || (FAILED(rc = pCtl->setIDEEmulationPort(1, ctlData.lIDE0SlaveEmulationPort)))
    9595                  || (FAILED(rc = pCtl->setIDEEmulationPort(2, ctlData.lIDE1MasterEmulationPort)))
    9596                  || (FAILED(rc = pCtl->setIDEEmulationPort(3, ctlData.lIDE1SlaveEmulationPort)))
     9593            if (    (FAILED(rc = pCtl->i_setIDEEmulationPort(0, ctlData.lIDE0MasterEmulationPort)))
     9594                 || (FAILED(rc = pCtl->i_setIDEEmulationPort(1, ctlData.lIDE0SlaveEmulationPort)))
     9595                 || (FAILED(rc = pCtl->i_setIDEEmulationPort(2, ctlData.lIDE1MasterEmulationPort)))
     9596                 || (FAILED(rc = pCtl->i_setIDEEmulationPort(3, ctlData.lIDE1SlaveEmulationPort)))
    95979597               )
    95989598                return rc;
     
    96479647                return setError(E_FAIL,
    96489648                                tr("Duplicate attachments for storage controller '%s', port %d, device %d of the virtual machine '%s'"),
    9649                                 aStorageController->getName().c_str(),
     9649                                aStorageController->i_getName().c_str(),
    96509650                                ad.lPort,
    96519651                                ad.lDevice,
     
    97819781        if (!dev.strBwGroup.isEmpty())
    97829782        {
    9783             rc = mBandwidthControl->getBandwidthGroupByName(dev.strBwGroup, pBwGroup, false /* aSetError */);
     9783            rc = mBandwidthControl->i_getBandwidthGroupByName(dev.strBwGroup, pBwGroup, false /* aSetError */);
    97849784            if (FAILED(rc))
    97859785                return setError(E_FAIL,
     
    97899789                                mUserData->s.strName.c_str(),
    97909790                                mData->m_strConfigFileFull.c_str());
    9791             pBwGroup->reference();
    9792         }
    9793 
    9794         const Bstr controllerName = aStorageController->getName();
     9791            pBwGroup->i_reference();
     9792        }
     9793
     9794        const Bstr controllerName = aStorageController->i_getName();
    97959795        ComObjPtr<MediumAttachment> pAttachment;
    97969796        pAttachment.createObject();
     
    98079807                               dev.fDiscard,
    98089808                               dev.fHotPluggable,
    9809                                pBwGroup.isNull() ? Utf8Str::Empty : pBwGroup->getName());
     9809                               pBwGroup.isNull() ? Utf8Str::Empty : pBwGroup->i_getName());
    98109810        if (FAILED(rc)) break;
    98119811
     
    99329932         ++it)
    99339933    {
    9934         if ((*it)->getName() == aName)
     9934        if ((*it)->i_getName() == aName)
    99359935        {
    99369936            aStorageController = (*it);
     
    1065610656
    1065710657        /* VRDEServer settings (optional) */
    10658         rc = mVRDEServer->saveSettings(data.vrdeSettings);
     10658        rc = mVRDEServer->i_saveSettings(data.vrdeSettings);
    1065910659        if (FAILED(rc)) throw rc;
    1066010660
     
    1070910709            settings::SerialPort s;
    1071010710            s.ulSlot = slot;
    10711             rc = mSerialPorts[slot]->saveSettings(s);
     10711            rc = mSerialPorts[slot]->i_saveSettings(s);
    1071210712            if (FAILED(rc)) return rc;
    1071310713
     
    1076510765
    1076610766        /* BandwidthControl (required) */
    10767         rc = mBandwidthControl->saveSettings(data.ioSettings);
     10767        rc = mBandwidthControl->i_saveSettings(data.ioSettings);
    1076810768        if (FAILED(rc)) throw rc;
    1076910769
     
    1084710847
    1084810848        settings::StorageController ctl;
    10849         ctl.strName = pCtl->getName();
    10850         ctl.controllerType = pCtl->getControllerType();
    10851         ctl.storageBus = pCtl->getStorageBus();
    10852         ctl.ulInstance = pCtl->getInstance();
    10853         ctl.fBootable = pCtl->getBootable();
     10849        ctl.strName = pCtl->i_getName();
     10850        ctl.controllerType = pCtl->i_getControllerType();
     10851        ctl.storageBus = pCtl->i_getStorageBus();
     10852        ctl.ulInstance = pCtl->i_getInstance();
     10853        ctl.fBootable = pCtl->i_getBootable();
    1085410854
    1085510855        /* Save the port count. */
     
    1086810868        if (ctl.controllerType == StorageControllerType_IntelAhci)
    1086910869        {
    10870             if (    (FAILED(rc = pCtl->getIDEEmulationPort(0, (LONG*)&ctl.lIDE0MasterEmulationPort)))
    10871                  || (FAILED(rc = pCtl->getIDEEmulationPort(1, (LONG*)&ctl.lIDE0SlaveEmulationPort)))
    10872                  || (FAILED(rc = pCtl->getIDEEmulationPort(2, (LONG*)&ctl.lIDE1MasterEmulationPort)))
    10873                  || (FAILED(rc = pCtl->getIDEEmulationPort(3, (LONG*)&ctl.lIDE1SlaveEmulationPort)))
     10870            if (    (FAILED(rc = pCtl->i_getIDEEmulationPort(0, (LONG*)&ctl.lIDE0MasterEmulationPort)))
     10871                 || (FAILED(rc = pCtl->i_getIDEEmulationPort(1, (LONG*)&ctl.lIDE0SlaveEmulationPort)))
     10872                 || (FAILED(rc = pCtl->i_getIDEEmulationPort(2, (LONG*)&ctl.lIDE1MasterEmulationPort)))
     10873                 || (FAILED(rc = pCtl->i_getIDEEmulationPort(3, (LONG*)&ctl.lIDE1SlaveEmulationPort)))
    1087410874               )
    1087510875                ComAssertComRCRet(rc, rc);
     
    1089410894    MediaData::AttachmentList atts;
    1089510895
    10896     HRESULT rc = getMediumAttachmentsOfController(Bstr(aStorageController->getName()).raw(), atts);
     10896    HRESULT rc = getMediumAttachmentsOfController(Bstr(aStorageController->i_getName()).raw(), atts);
    1089710897    if (FAILED(rc)) return rc;
    1089810898
     
    1206312063            while (it != mStorageControllers->end())
    1206412064            {
    12065                 (*it)->rollback();
     12065                (*it)->i_rollback();
    1206612066                ++it;
    1206712067            }
     
    1211412114
    1211512115    if (mVRDEServer && (mData->flModifications & IsModified_VRDEServer))
    12116         mVRDEServer->rollback();
     12116        mVRDEServer->i_rollback();
    1211712117
    1211812118    if (mAudioAdapter)
     
    1212312123
    1212412124    if (mBandwidthControl && (mData->flModifications & IsModified_BandwidthControl))
    12125         mBandwidthControl->rollback();
     12125        mBandwidthControl->i_rollback();
    1212612126
    1212712127    if (!mHWData.isNull())
     
    1214312143        for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
    1214412144            if (    mSerialPorts[slot]
    12145                  && mSerialPorts[slot]->isModified())
     12145                 && mSerialPorts[slot]->i_isModified())
    1214612146            {
    12147                 mSerialPorts[slot]->rollback();
     12147                mSerialPorts[slot]->i_rollback();
    1214812148                serialPorts[slot] = mSerialPorts[slot];
    1214912149            }
     
    1222312223
    1222412224    mBIOSSettings->commit();
    12225     mVRDEServer->commit();
     12225    mVRDEServer->i_commit();
    1222612226    mAudioAdapter->commit();
    1222712227    mUSBDeviceFilters->commit();
    12228     mBandwidthControl->commit();
     12228    mBandwidthControl->i_commit();
    1222912229
    1223012230    /* Since mNetworkAdapters is a list which might have been changed (resized)
     
    1228012280
    1228112281    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
    12282         mSerialPorts[slot]->commit();
     12282        mSerialPorts[slot]->i_commit();
    1228312283    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
    1228412284        mParallelPorts[slot]->commit();
     
    1229812298            while (it != mStorageControllers->end())
    1229912299            {
    12300                 (*it)->commit();
     12300                (*it)->i_commit();
    1230112301
    1230212302                /* look if this controller has a peer device */
    12303                 ComObjPtr<StorageController> peer = (*it)->getPeer();
     12303                ComObjPtr<StorageController> peer = (*it)->i_getPeer();
    1230412304                if (!peer)
    1230512305                {
     
    1235012350        while (it != mStorageControllers->end())
    1235112351        {
    12352             (*it)->commit();
     12352            (*it)->i_commit();
    1235312353            ++it;
    1235412354        }
     
    1247212472
    1247312473    mBIOSSettings->copyFrom(aThat->mBIOSSettings);
    12474     mVRDEServer->copyFrom(aThat->mVRDEServer);
     12474    mVRDEServer->i_copyFrom(aThat->mVRDEServer);
    1247512475    mAudioAdapter->copyFrom(aThat->mAudioAdapter);
    1247612476    mUSBDeviceFilters->copyFrom(aThat->mUSBDeviceFilters);
    12477     mBandwidthControl->copyFrom(aThat->mBandwidthControl);
     12477    mBandwidthControl->i_copyFrom(aThat->mBandwidthControl);
    1247812478
    1247912479    /* create private copies of all controllers */
     
    1250712507        mNetworkAdapters[slot]->copyFrom(aThat->mNetworkAdapters[slot]);
    1250812508    for (ULONG slot = 0; slot < RT_ELEMENTS(mSerialPorts); slot++)
    12509         mSerialPorts[slot]->copyFrom(aThat->mSerialPorts[slot]);
     12509        mSerialPorts[slot]->i_copyFrom(aThat->mSerialPorts[slot]);
    1251012510    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
    1251112511        mParallelPorts[slot]->copyFrom(aThat->mParallelPorts[slot]);
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r49590 r49644  
    12461246    {
    12471247        ComObjPtr<BandwidthGroup> group;
    1248         rc = bwctl->getBandwidthGroupByName(data.strBandwidthGroup, group, true);
     1248        rc = bwctl->i_getBandwidthGroupByName(data.strBandwidthGroup, group, true);
    12491249        if (FAILED(rc)) return rc;
    1250         group->reference();
     1250        group->i_reference();
    12511251    }
    12521252
     
    14201420#endif // VBOX_WITH_E1000
    14211421
    1422     NetworkAdapterType_T defaultType = aOsType->networkAdapterType();
     1422    NetworkAdapterType_T defaultType = aOsType->i_networkAdapterType();
    14231423
    14241424    /* Set default network adapter for this OS type */
     
    15061506    Utf8Str strBwGroup;
    15071507    if (aBwGroup)
    1508         strBwGroup = static_cast<BandwidthGroup*>(aBwGroup)->getName();
     1508        strBwGroup = static_cast<BandwidthGroup*>(aBwGroup)->i_getName();
    15091509    if (mData->mBandwidthGroup != strBwGroup)
    15101510    {
     
    15511551    if (!pOldBwGroup.isNull())
    15521552    {
    1553         pOldBwGroup->release();
     1553        pOldBwGroup->i_release();
    15541554        mData->mBandwidthGroup = Utf8Str::Empty;
    15551555    }
     
    15571557    if (aBwGroup)
    15581558    {
    1559         mData->mBandwidthGroup = aBwGroup->getName();
    1560         aBwGroup->reference();
     1559        mData->mBandwidthGroup = aBwGroup->i_getName();
     1560        aBwGroup->i_reference();
    15611561    }
    15621562
  • trunk/src/VBox/Main/src-server/SerialPortImpl.cpp

    r44528 r49644  
    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
     
    3030#include "Logging.h"
    3131
    32 ////////////////////////////////////////////////////////////////////////////////
    33 //
    34 // SerialPort private data definition
    35 //
    36 ////////////////////////////////////////////////////////////////////////////////
    37 
    38 struct SerialPort::Data
    39 {
    40     Data()
    41         : fModified(false),
    42           pMachine(NULL)
    43     { }
    44 
    45     bool                                fModified;
    46 
    47     Machine * const                     pMachine;
    48     const ComObjPtr<SerialPort>         pPeer;
    49 
    50     Backupable<settings::SerialPort>    bd;
    51 };
    52 
    5332// constructor / destructor
    5433/////////////////////////////////////////////////////////////////////////////
     
    197176/////////////////////////////////////////////////////////////////////////////
    198177
    199 STDMETHODIMP SerialPort::COMGETTER(Enabled) (BOOL *aEnabled)
    200 {
    201     CheckComArgOutPointerValid(aEnabled);
    202 
    203     AutoCaller autoCaller(this);
    204     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    205 
     178HRESULT SerialPort::getEnabled(BOOL *aEnabled)
     179{
    206180    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    207181
     
    211185}
    212186
    213 STDMETHODIMP SerialPort::COMSETTER(Enabled) (BOOL aEnabled)
     187
     188HRESULT SerialPort::setEnabled(BOOL aEnabled)
    214189{
    215190    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
    216 
    217     AutoCaller autoCaller(this);
    218     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    219191
    220192    /* the machine needs to be mutable */
     
    243215}
    244216
    245 STDMETHODIMP SerialPort::COMGETTER(HostMode) (PortMode_T *aHostMode)
    246 {
    247     CheckComArgOutPointerValid(aHostMode);
    248 
    249     AutoCaller autoCaller(this);
    250     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    251 
     217
     218HRESULT SerialPort::getHostMode(PortMode_T *aHostMode)
     219{
    252220    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    253221
     
    257225}
    258226
    259 STDMETHODIMP SerialPort::COMSETTER(HostMode) (PortMode_T aHostMode)
    260 {
    261     AutoCaller autoCaller(this);
    262     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    263 
     227HRESULT SerialPort::setHostMode(PortMode_T aHostMode)
     228{
    264229    /* the machine needs to be mutable */
    265230    AutoMutableStateDependency adep(m->pMachine);
     
    314279}
    315280
    316 STDMETHODIMP SerialPort::COMGETTER(Slot) (ULONG *aSlot)
    317 {
    318     CheckComArgOutPointerValid(aSlot);
    319 
    320     AutoCaller autoCaller(this);
    321     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    322 
     281HRESULT SerialPort::getSlot(ULONG *aSlot)
     282{
    323283    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    324284
     
    328288}
    329289
    330 STDMETHODIMP SerialPort::COMGETTER(IRQ) (ULONG *aIRQ)
    331 {
    332     CheckComArgOutPointerValid(aIRQ);
    333 
    334     AutoCaller autoCaller(this);
    335     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    336 
     290
     291HRESULT SerialPort::getIRQ(ULONG *aIRQ)
     292{
    337293    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    338294
     
    342298}
    343299
    344 STDMETHODIMP SerialPort::COMSETTER(IRQ)(ULONG aIRQ)
     300
     301HRESULT SerialPort::setIRQ(ULONG aIRQ)
    345302{
    346303    /* check IRQ limits
     
    351308                        m->bd->ulSlot, aIRQ, 255);
    352309
    353     AutoCaller autoCaller(this);
    354     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    355 
    356310    /* the machine needs to be mutable */
    357311    AutoMutableStateDependency adep(m->pMachine);
     
    379333}
    380334
    381 STDMETHODIMP SerialPort::COMGETTER(IOBase) (ULONG *aIOBase)
    382 {
    383     CheckComArgOutPointerValid(aIOBase);
    384 
    385     AutoCaller autoCaller(this);
    386     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    387 
     335
     336HRESULT SerialPort::getIOBase(ULONG *aIOBase)
     337{
    388338    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    389339
     
    393343}
    394344
    395 STDMETHODIMP SerialPort::COMSETTER(IOBase)(ULONG aIOBase)
     345HRESULT SerialPort::setIOBase(ULONG aIOBase)
    396346{
    397347    /* check IOBase limits
     
    432382}
    433383
    434 STDMETHODIMP SerialPort::COMGETTER(Path) (BSTR *aPath)
    435 {
    436     CheckComArgOutPointerValid(aPath);
    437 
    438     AutoCaller autoCaller(this);
    439     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    440 
    441     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    442 
    443     m->bd->strPath.cloneTo(aPath);
    444 
    445     return S_OK;
    446 }
    447 
    448 STDMETHODIMP SerialPort::COMSETTER(Path) (IN_BSTR aPath)
    449 {
    450     AutoCaller autoCaller(this);
    451     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    452 
     384HRESULT SerialPort::getPath(com::Utf8Str &aPath)
     385{
     386    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     387
     388    aPath = m->bd->strPath;
     389
     390    return S_OK;
     391}
     392
     393
     394HRESULT SerialPort::setPath(const com::Utf8Str &aPath)
     395{
    453396    /* the machine needs to be mutable */
    454397    AutoMutableStateDependency adep(m->pMachine);
     
    457400    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    458401
     402    com::Utf8Str strPath = aPath;
     403
    459404    /* we treat empty as null when e.g. saving to XML, do the same here */
    460     if (aPath && *aPath == '\0')
    461         aPath = NULL;
    462 
    463     Utf8Str str(aPath);
    464     if (str != m->bd->strPath)
    465     {
    466         HRESULT rc = checkSetPath(str);
     405    if (!strPath.isEmpty())
     406        strPath = "";
     407
     408    if (strPath != m->bd->strPath)
     409    {
     410        HRESULT rc = i_checkSetPath(strPath);
    467411        if (FAILED(rc)) return rc;
    468412
    469413        m->bd.backup();
    470         m->bd->strPath = str;
     414        m->bd->strPath = strPath;
    471415
    472416        m->fModified = true;
     
    484428}
    485429
    486 STDMETHODIMP SerialPort::COMGETTER(Server) (BOOL *aServer)
    487 {
    488     CheckComArgOutPointerValid(aServer);
    489 
    490     AutoCaller autoCaller(this);
    491     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    492 
     430HRESULT SerialPort::getServer(BOOL *aServer)
     431{
    493432    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    494433
     
    498437}
    499438
    500 STDMETHODIMP SerialPort::COMSETTER(Server) (BOOL aServer)
    501 {
    502     AutoCaller autoCaller(this);
    503     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    504 
     439HRESULT SerialPort::setServer(BOOL aServer)
     440{
    505441    /* the machine needs to be mutable */
    506442    AutoMutableStateDependency adep(m->pMachine);
     
    539475 *  @note Locks this object for writing.
    540476 */
    541 HRESULT SerialPort::loadSettings(const settings::SerialPort &data)
    542 {
     477HRESULT SerialPort::i_loadSettings(const settings::SerialPort &data)
     478{
     479
    543480    AutoCaller autoCaller(this);
    544481    AssertComRCReturnRC(autoCaller.rc());
     
    561498 *  @note Locks this object for reading.
    562499 */
    563 HRESULT SerialPort::saveSettings(settings::SerialPort &data)
     500HRESULT SerialPort::i_saveSettings(settings::SerialPort &data)
    564501{
    565502    AutoCaller autoCaller(this);
     
    578515 * @return
    579516 */
    580 bool SerialPort::isModified()
     517bool SerialPort::i_isModified()
    581518{
    582519    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    587524 *  @note Locks this object for writing.
    588525 */
    589 void SerialPort::rollback()
     526void SerialPort::i_rollback()
    590527{
    591528    /* sanity */
     
    602539 *  for writing) if there is one.
    603540 */
    604 void SerialPort::commit()
     541void SerialPort::i_commit()
    605542{
    606543    /* sanity */
     
    631568 *  represented by @a aThat (locked for reading).
    632569 */
    633 void SerialPort::copyFrom (SerialPort *aThat)
     570void SerialPort::i_copyFrom (SerialPort *aThat)
    634571{
    635572    AssertReturnVoid (aThat != NULL);
     
    652589}
    653590
    654 void SerialPort::applyDefaults (GuestOSType *aOsType)
     591void SerialPort::i_applyDefaults (GuestOSType *aOsType)
    655592{
    656593    AssertReturnVoid (aOsType != NULL);
     
    688625    }
    689626
    690     uint32_t numSerialEnabled = aOsType->numSerialEnabled();
     627    uint32_t numSerialEnabled = aOsType->i_numSerialEnabled();
    691628
    692629    /* Enable port if requested */
     
    700637 *  Validates COMSETTER(Path) arguments.
    701638 */
    702 HRESULT SerialPort::checkSetPath(const Utf8Str &str)
     639HRESULT SerialPort::i_checkSetPath(const Utf8Str &str)
    703640{
    704641    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r48985 r49644  
    77
    88/*
    9  * Copyright (C) 2008-2012 Oracle Corporation
     9 * Copyright (C) 2008-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737// defines
    3838/////////////////////////////////////////////////////////////////////////////
     39//
     40//
     41DEFINE_EMPTY_CTOR_DTOR(StorageController)
    3942
    4043struct BackupableStorageControllerData
     
    9396    VirtualBox * const                  pVirtualBox;
    9497    SystemProperties * const            pSystemProperties;
    95 
    9698    Machine * const                     pParent;
    9799    const ComObjPtr<StorageController>  pPeer;
     
    99101    Backupable<BackupableStorageControllerData> bd;
    100102};
     103
    101104
    102105// constructor / destructor
     
    315318
    316319// IStorageController properties
    317 /////////////////////////////////////////////////////////////////////////////
    318 STDMETHODIMP StorageController::COMGETTER(Name) (BSTR *aName)
    319 {
    320     CheckComArgOutPointerValid(aName);
    321 
    322     AutoCaller autoCaller(this);
    323     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     320HRESULT StorageController::getName(com::Utf8Str &aName)
     321{
     322    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    324323
    325324    /* mName is constant during life time, no need to lock */
    326     m->bd.data()->strName.cloneTo(aName);
    327 
    328     return S_OK;
    329 }
    330 
    331 STDMETHODIMP StorageController::COMGETTER(Bus) (StorageBus_T *aBus)
     325    aName = m->bd.data()->strName;
     326
     327    return S_OK;
     328}
     329
     330HRESULT StorageController::getBus(StorageBus_T *aBus)
    332331{
    333332    CheckComArgOutPointerValid(aBus);
    334333
    335     AutoCaller autoCaller(this);
    336     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    337 
    338334    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    339335
     
    343339}
    344340
    345 STDMETHODIMP StorageController::COMGETTER(ControllerType) (StorageControllerType_T *aControllerType)
     341HRESULT StorageController::getControllerType(StorageControllerType_T *aControllerType)
    346342{
    347343    CheckComArgOutPointerValid(aControllerType);
    348344
    349     AutoCaller autoCaller(this);
    350     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    351 
    352345    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    353346
     
    357350}
    358351
    359 STDMETHODIMP StorageController::COMSETTER(ControllerType) (StorageControllerType_T aControllerType)
    360 {
    361     AutoCaller autoCaller(this);
    362     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    363 
     352HRESULT StorageController::setControllerType(StorageControllerType_T aControllerType)
     353{
    364354    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    365355
     
    421411}
    422412
    423 STDMETHODIMP StorageController::COMGETTER(MaxDevicesPerPortCount) (ULONG *aMaxDevices)
    424 {
    425     CheckComArgOutPointerValid(aMaxDevices);
    426 
    427     AutoCaller autoCaller(this);
    428     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    429 
    430     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    431     HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->mStorageBus, aMaxDevices);
     413HRESULT StorageController::getMaxDevicesPerPortCount(ULONG *aMaxDevicesPerPortCount)
     414{
     415    CheckComArgOutPointerValid(aMaxDevicesPerPortCount);
     416
     417    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     418
     419    HRESULT rc = m->pSystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->mStorageBus, aMaxDevicesPerPortCount);
    432420
    433421    return rc;
    434422}
    435423
    436 STDMETHODIMP StorageController::COMGETTER(MinPortCount) (ULONG *aMinPortCount)
     424HRESULT StorageController::getMinPortCount(ULONG *aMinPortCount)
    437425{
    438426    CheckComArgOutPointerValid(aMinPortCount);
    439427
    440     AutoCaller autoCaller(this);
    441     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    442 
    443     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     428    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     429
    444430    HRESULT rc = m->pSystemProperties->GetMinPortCountForStorageBus(m->bd->mStorageBus, aMinPortCount);
    445 
    446431    return rc;
    447432}
    448433
    449 STDMETHODIMP StorageController::COMGETTER(MaxPortCount) (ULONG *aMaxPortCount)
     434HRESULT StorageController::getMaxPortCount(ULONG *aMaxPortCount)
    450435{
    451436    CheckComArgOutPointerValid(aMaxPortCount);
    452437
    453     AutoCaller autoCaller(this);
    454     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    455 
    456438    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    457439    HRESULT rc = m->pSystemProperties->GetMaxPortCountForStorageBus(m->bd->mStorageBus, aMaxPortCount);
     
    460442}
    461443
    462 
    463 STDMETHODIMP StorageController::COMGETTER(PortCount) (ULONG *aPortCount)
     444HRESULT StorageController::getPortCount(ULONG *aPortCount)
    464445{
    465446    CheckComArgOutPointerValid(aPortCount);
    466447
    467     AutoCaller autoCaller(this);
    468     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    469 
    470448    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    471449
     
    475453}
    476454
    477 
    478 STDMETHODIMP StorageController::COMSETTER(PortCount) (ULONG aPortCount)
     455HRESULT StorageController::setPortCount(ULONG aPortCount)
    479456{
    480457    LogFlowThisFunc(("aPortCount=%u\n", aPortCount));
     
    576553}
    577554
    578 STDMETHODIMP StorageController::COMGETTER(Instance) (ULONG *aInstance)
    579 {
    580     AutoCaller autoCaller(this);
    581     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    582 
     555HRESULT StorageController::getInstance(ULONG *aInstance)
     556{
    583557    /* The machine doesn't need to be mutable. */
    584558
     
    590564}
    591565
    592 STDMETHODIMP StorageController::COMSETTER(Instance) (ULONG aInstance)
    593 {
    594     AutoCaller autoCaller(this);
    595     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    596 
     566HRESULT StorageController::setInstance(ULONG aInstance)
     567{
    597568    /* The machine doesn't need to be mutable. */
    598569
     
    604575}
    605576
    606 STDMETHODIMP StorageController::COMGETTER(UseHostIOCache) (BOOL *fUseHostIOCache)
    607 {
    608     AutoCaller autoCaller(this);
    609     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    610 
     577HRESULT StorageController::getUseHostIOCache(BOOL *fUseHostIOCache)
     578{
    611579    /* The machine doesn't need to be mutable. */
    612580
     
    618586}
    619587
    620 STDMETHODIMP StorageController::COMSETTER(UseHostIOCache) (BOOL fUseHostIOCache)
    621 {
    622     AutoCaller autoCaller(this);
    623     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    624 
     588HRESULT StorageController::setUseHostIOCache(BOOL fUseHostIOCache)
     589{
    625590    /* the machine needs to be mutable */
    626591    AutoMutableStateDependency adep(m->pParent);
     
    645610}
    646611
    647 STDMETHODIMP StorageController::COMGETTER(Bootable) (BOOL *fBootable)
    648 {
    649     AutoCaller autoCaller(this);
    650     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     612HRESULT StorageController::getBootable(BOOL *fBootable)
     613{
    651614
    652615    /* The machine doesn't need to be mutable. */
     
    662625/////////////////////////////////////////////////////////////////////////////
    663626
    664 HRESULT StorageController::getIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber)
     627HRESULT StorageController::i_getIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber)
    665628{
    666629    CheckComArgOutPointerValid(aPortNumber);
     
    696659}
    697660
    698 HRESULT StorageController::setIDEEmulationPort(LONG DevicePosition, LONG aPortNumber)
     661HRESULT StorageController::i_setIDEEmulationPort(LONG DevicePosition, LONG aPortNumber)
    699662{
    700663    AutoCaller autoCaller(this);
     
    736699}
    737700
    738 const Utf8Str& StorageController::getName() const
     701const Utf8Str& StorageController::i_getName() const
    739702{
    740703    return m->bd->strName;
    741704}
    742705
    743 StorageControllerType_T StorageController::getControllerType() const
     706StorageControllerType_T StorageController::i_getControllerType() const
    744707{
    745708    return m->bd->mStorageControllerType;
    746709}
    747710
    748 StorageBus_T StorageController::getStorageBus() const
     711StorageBus_T StorageController::i_getStorageBus() const
    749712{
    750713    return m->bd->mStorageBus;
    751714}
    752715
    753 ULONG StorageController::getInstance() const
     716ULONG StorageController::i_getInstance() const
    754717{
    755718    return m->bd->mInstance;
    756719}
    757720
    758 bool StorageController::getBootable() const
     721bool StorageController::i_getBootable() const
    759722{
    760723    return !!m->bd->fBootable;
     
    768731 * @return
    769732 */
    770 HRESULT StorageController::checkPortAndDeviceValid(LONG aControllerPort,
    771                                                    LONG aDevice)
     733HRESULT StorageController::i_checkPortAndDeviceValid(LONG aControllerPort,
     734                                                     LONG aDevice)
    772735{
    773736    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    791754
    792755/** @note Locks objects for writing! */
    793 void StorageController::setBootable(BOOL fBootable)
     756void StorageController::i_setBootable(BOOL fBootable)
    794757{
    795758    AutoCaller autoCaller(this);
     
    803766
    804767/** @note Locks objects for writing! */
    805 void StorageController::rollback()
     768void StorageController::i_rollback()
    806769{
    807770    AutoCaller autoCaller(this);
     
    817780 *  for writing) if there is one.
    818781 */
    819 void StorageController::commit()
     782void StorageController::i_commit()
    820783{
    821784    /* sanity */
     
    849812 *  represented by @a aThat (locked for reading).
    850813 */
    851 void StorageController::unshare()
     814void StorageController::i_unshare()
    852815{
    853816    /* sanity */
     
    875838}
    876839
    877 Machine* StorageController::getMachine()
     840Machine* StorageController::i_getMachine()
    878841{
    879842    return m->pParent;
    880843}
    881844
    882 ComObjPtr<StorageController> StorageController::getPeer()
     845ComObjPtr<StorageController> StorageController::i_getPeer()
    883846{
    884847    return m->pPeer;
  • trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp

    r49586 r49644  
    66
    77/*
    8  * Copyright (C) 2009-2011 Oracle Corporation
     8 * Copyright (C) 2009-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3737#include <memory>
    3838
    39 ////////////////////////////////////////////////////////////////////////////////
    40 //
    41 // VFSExplorer definitions
    42 //
    43 ////////////////////////////////////////////////////////////////////////////////
    44 
    45 /* opaque private instance data of VFSExplorer class */
    46 struct VFSExplorer::Data
    47 {
    48     struct DirEntry
    49     {
    50         DirEntry(Utf8Str strName, VFSFileType_T fileType, uint64_t cbSize, uint32_t fMode)
    51           : name(strName)
    52           , type(fileType)
    53           , size(cbSize)
    54           , mode(fMode) {}
    55 
    56         Utf8Str name;
    57         VFSFileType_T type;
    58         uint64_t size;
    59         uint32_t mode;
    60     };
    61 
    62     VFSType_T storageType;
    63     Utf8Str strUsername;
    64     Utf8Str strPassword;
    65     Utf8Str strHostname;
    66     Utf8Str strPath;
    67     Utf8Str strBucket;
    68 
    69     std::list<DirEntry> entryList;
    70 };
    71 
    7239VFSExplorer::VFSExplorer()
    7340    : mVirtualBox(NULL)
     
    134101 * @return
    135102 */
    136 STDMETHODIMP VFSExplorer::COMGETTER(Path)(BSTR *aPath)
    137 {
    138     if (!aPath)
    139         return E_POINTER;
    140 
    141     AutoCaller autoCaller(this);
    142     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    143 
     103HRESULT VFSExplorer::getPath(com::Utf8Str &aPath)
     104{
    144105    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    145106
    146     Bstr bstrPath(m->strPath);
    147     bstrPath.cloneTo(aPath);
     107    aPath = m->strPath;
    148108
    149109    return S_OK;
    150110}
    151111
    152 STDMETHODIMP VFSExplorer::COMGETTER(Type)(VFSType_T *aType)
     112
     113HRESULT VFSExplorer::getType(VFSType_T *aType)
    153114{
    154115    if (!aType)
    155116        return E_POINTER;
    156 
    157     AutoCaller autoCaller(this);
    158     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    159117
    160118    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    224182        {
    225183            if (pVFSExplorer->m->storageType == VFSType_File)
    226                 rc = pVFSExplorer->updateFS(task.get());
     184                rc = pVFSExplorer->i_updateFS(task.get());
    227185            else if (pVFSExplorer->m->storageType == VFSType_S3)
    228186#ifdef VBOX_WITH_S3
    229                 rc = pVFSExplorer->updateS3(task.get());
     187                rc = pVFSExplorer->i_updateS3(task.get());
    230188#else
    231189                rc = VERR_NOT_IMPLEMENTED;
     
    236194        {
    237195            if (pVFSExplorer->m->storageType == VFSType_File)
    238                 rc = pVFSExplorer->deleteFS(task.get());
     196                rc = pVFSExplorer->i_deleteFS(task.get());
    239197            else if (pVFSExplorer->m->storageType == VFSType_S3)
    240198#ifdef VBOX_WITH_S3
    241                 rc = pVFSExplorer->deleteS3(task.get());
     199                rc = pVFSExplorer->i_deleteS3(task.get());
    242200#else
    243201                rc = VERR_NOT_IMPLEMENTED;
     
    273231}
    274232
    275 VFSFileType_T VFSExplorer::RTToVFSFileType(int aType) const
     233VFSFileType_T VFSExplorer::i_RTToVFSFileType(int aType) const
    276234{
    277235    int a = aType & RTFS_TYPE_MASK;
     
    297255}
    298256
    299 HRESULT VFSExplorer::updateFS(TaskVFSExplorer *aTask)
     257HRESULT VFSExplorer::i_updateFS(TaskVFSExplorer *aTask)
    300258{
    301259    LogFlowFuncEnter();
     
    328286                if (   name != "."
    329287                    && name != "..")
    330                     fileList.push_back(VFSExplorer::Data::DirEntry(name, RTToVFSFileType(entry.Info.Attr.fMode), entry.Info.cbObject, entry.Info.Attr.fMode & (RTFS_UNIX_IRWXU | RTFS_UNIX_IRWXG | RTFS_UNIX_IRWXO)));
     288                    fileList.push_back(VFSExplorer::Data::DirEntry(name, i_RTToVFSFileType(entry.Info.Attr.fMode), entry.Info.cbObject, entry.Info.Attr.fMode & (RTFS_UNIX_IRWXU | RTFS_UNIX_IRWXG | RTFS_UNIX_IRWXO)));
    331289            }
    332290        }
     
    363321}
    364322
    365 HRESULT VFSExplorer::deleteFS(TaskVFSExplorer *aTask)
     323HRESULT VFSExplorer::i_deleteFS(TaskVFSExplorer *aTask)
    366324{
    367325    LogFlowFuncEnter();
     
    411369
    412370#ifdef VBOX_WITH_S3
    413 HRESULT VFSExplorer::updateS3(TaskVFSExplorer *aTask)
     371HRESULT VFSExplorer::i_updateS3(TaskVFSExplorer *aTask)
    414372{
    415373    LogFlowFuncEnter();
     
    490448}
    491449
    492 HRESULT VFSExplorer::deleteS3(TaskVFSExplorer *aTask)
     450HRESULT VFSExplorer::i_deleteS3(TaskVFSExplorer *aTask)
    493451{
    494452    LogFlowFuncEnter();
     
    545503#endif /* VBOX_WITH_S3 */
    546504
    547 STDMETHODIMP VFSExplorer::Update(IProgress **aProgress)
    548 {
    549     CheckComArgOutPointerValid(aProgress);
    550 
    551     AutoCaller autoCaller(this);
    552     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    553 
     505HRESULT VFSExplorer::update(ComPtr<IProgress> &aProgress)
     506{
    554507    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    555508
     
    584537    }
    585538
    586     if (SUCCEEDED(rc))
     539     if (SUCCEEDED(rc))
    587540        /* Return progress to the caller */
    588         progress.queryInterfaceTo(aProgress);
     541        progress.queryInterfaceTo(aProgress.asOutParam());
    589542
    590543    return rc;
    591544}
    592545
    593 STDMETHODIMP VFSExplorer::Cd(IN_BSTR aDir, IProgress **aProgress)
    594 {
    595     CheckComArgStrNotEmptyOrNull(aDir);
    596 
    597     AutoCaller autoCaller(this);
    598     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    599 
    600     {
    601         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    602         m->strPath = aDir;
    603     }
    604 
    605     return Update(aProgress);
    606 }
    607 
    608 STDMETHODIMP VFSExplorer::CdUp(IProgress **aProgress)
    609 {
    610     AutoCaller autoCaller(this);
    611     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    612 
     546HRESULT VFSExplorer::cd(const com::Utf8Str &aDir, ComPtr<IProgress> &aProgress)
     547{
     548    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     549    m->strPath = aDir;
     550    return update(aProgress);
     551}
     552
     553HRESULT VFSExplorer::cdUp(ComPtr<IProgress> &aProgress)
     554{
    613555    Utf8Str strUpPath;
    614556    {
     
    622564    }
    623565
    624     return Cd(Bstr(strUpPath).raw(), aProgress);
    625 }
    626 
    627 STDMETHODIMP VFSExplorer::EntryList(ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(VFSFileType_T, aTypes), ComSafeArrayOut(LONG64, aSizes), ComSafeArrayOut(ULONG, aModes))
    628 {
    629     if (ComSafeArrayOutIsNull(aNames) ||
    630         ComSafeArrayOutIsNull(aTypes))
    631         return E_POINTER;
    632 
    633     AutoCaller autoCaller(this);
    634     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    635 
     566    return cd(strUpPath, aProgress);
     567}
     568
     569HRESULT VFSExplorer::entryList(std::vector<com::Utf8Str> &aNames,
     570                               std::vector<ULONG> &aTypes,
     571                               std::vector<LONG64> &aSizes,
     572                               std::vector<ULONG> &aModes)
     573{
    636574    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    637 
    638     com::SafeArray<BSTR> sfaNames(m->entryList.size());
    639     com::SafeArray<ULONG> sfaTypes(m->entryList.size());
    640     com::SafeArray<LONG64> sfaSizes(m->entryList.size());
    641     com::SafeArray<ULONG> sfaModes(m->entryList.size());
     575    aNames.resize(m->entryList.size());
     576    aTypes.resize(m->entryList.size());
     577    aSizes.resize(m->entryList.size());
     578    aModes.resize(m->entryList.size());
    642579
    643580    std::list<VFSExplorer::Data::DirEntry>::const_iterator it;
     
    648585    {
    649586        const VFSExplorer::Data::DirEntry &entry = (*it);
    650         Bstr bstr(entry.name);
    651         bstr.cloneTo(&sfaNames[i]);
    652         sfaTypes[i] = entry.type;
    653         sfaSizes[i] = entry.size;
    654         sfaModes[i] = entry.mode;
    655     }
    656 
    657     sfaNames.detachTo(ComSafeArrayOutArg(aNames));
    658     sfaTypes.detachTo(ComSafeArrayOutArg(aTypes));
    659     sfaSizes.detachTo(ComSafeArrayOutArg(aSizes));
    660     sfaModes.detachTo(ComSafeArrayOutArg(aModes));
     587        aNames[i] = entry.name;
     588        aTypes[i] = entry.type;
     589        aSizes[i] = entry.type;
     590        aModes[i] = entry.mode;
     591    }
    661592
    662593    return S_OK;
    663594}
    664595
    665 STDMETHODIMP VFSExplorer::Exists(ComSafeArrayIn(IN_BSTR, aNames), ComSafeArrayOut(BSTR, aExists))
    666 {
    667     CheckComArgSafeArrayNotNull(aNames);
     596HRESULT VFSExplorer::exists(const std::vector<com::Utf8Str> &aNames,
     597                            std::vector<com::Utf8Str> &aExists)
     598{
    668599
    669600    AutoCaller autoCaller(this);
     
    671602
    672603    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    673 
    674     com::SafeArray<IN_BSTR> sfaNames(ComSafeArrayInArg(aNames));
    675     std::list<BSTR> listExists;
    676 
    677     for (size_t a=0; a < sfaNames.size(); ++a)
     604    aExists.resize(0);
     605    for (size_t i=0; i < aNames.size(); ++i)
    678606    {
    679607        std::list<VFSExplorer::Data::DirEntry>::const_iterator it;
     
    683611        {
    684612            const VFSExplorer::Data::DirEntry &entry = (*it);
    685             if (entry.name == RTPathFilename(Utf8Str(sfaNames[a]).c_str()))
    686             {
    687                 BSTR name;
    688                 Bstr tmp(sfaNames[a]); /* gcc-3.3 cruft */
    689                 tmp.cloneTo(&name);
    690                 listExists.push_back(name);
    691             }
    692         }
    693     }
    694 
    695     com::SafeArray<BSTR> sfaExists(listExists);
    696     sfaExists.detachTo(ComSafeArrayOutArg(aExists));
     613            if (entry.name == RTPathFilename(aNames[i].c_str()))
     614                aExists.push_back(aNames[i]);
     615        }
     616    }
    697617
    698618    return S_OK;
    699619}
    700620
    701 STDMETHODIMP VFSExplorer::Remove(ComSafeArrayIn(IN_BSTR, aNames), IProgress **aProgress)
    702 {
    703     CheckComArgSafeArrayNotNull(aNames);
    704     CheckComArgOutPointerValid(aProgress);
    705 
     621HRESULT VFSExplorer::remove(const std::vector<com::Utf8Str> &aNames,
     622                            ComPtr<IProgress> &aProgress)
     623{
    706624    AutoCaller autoCaller(this);
    707625    if (FAILED(autoCaller.rc())) return autoCaller.rc();
     
    710628
    711629    HRESULT rc = S_OK;
    712 
    713     com::SafeArray<IN_BSTR> sfaNames(ComSafeArrayInArg(aNames));
    714630
    715631    ComObjPtr<Progress> progress;
     
    728644
    729645        /* Add all filenames to delete as task data */
    730         for (size_t a=0; a < sfaNames.size(); ++a)
    731             task->filenames.push_back(Utf8Str(sfaNames[a]));
     646        for (size_t i = 0; i < aNames.size(); ++i)
     647            task->filenames.push_back(aNames[i]);
    732648
    733649        rc = task->startThread();
     
    744660    if (SUCCEEDED(rc))
    745661        /* Return progress to the caller */
    746         progress.queryInterfaceTo(aProgress);
     662        progress.queryInterfaceTo(aProgress.asOutParam());
    747663
    748664    return rc;
  • trunk/src/VBox/Main/src-server/VRDEServerImpl.cpp

    r46820 r49644  
    197197 *  @note Locks this object for writing.
    198198 */
    199 HRESULT VRDEServer::loadSettings(const settings::VRDESettings &data)
     199HRESULT VRDEServer::i_loadSettings(const settings::VRDESettings &data)
    200200{
    201201    using namespace settings;
     
    205205
    206206    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    207 
    208207    mData->mEnabled = data.fEnabled;
    209208    mData->mAuthType = data.authType;
     
    225224 *  @note Locks this object for reading.
    226225 */
    227 HRESULT VRDEServer::saveSettings(settings::VRDESettings &data)
     226HRESULT VRDEServer::i_saveSettings(settings::VRDESettings &data)
    228227{
    229228    AutoCaller autoCaller(this);
     
    247246/////////////////////////////////////////////////////////////////////////////
    248247
    249 STDMETHODIMP VRDEServer::COMGETTER(Enabled)(BOOL *aEnabled)
    250 {
    251     CheckComArgOutPointerValid(aEnabled);
    252 
    253     AutoCaller autoCaller(this);
    254     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     248HRESULT VRDEServer::getEnabled(BOOL *aEnabled)
     249{
     250    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    255251
    256252    *aEnabled = mData->mEnabled;
     
    259255}
    260256
    261 STDMETHODIMP VRDEServer::COMSETTER(Enabled)(BOOL aEnabled)
    262 {
    263     AutoCaller autoCaller(this);
    264     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    265 
     257HRESULT VRDEServer::setEnabled(BOOL aEnabled)
     258{
    266259    /* the machine can also be in saved state for this property to change */
    267260    AutoMutableOrSavedStateDependency adep(mParent);
     
    293286}
    294287
    295 static int portParseNumber(uint16_t *pu16Port, const char *pszStart, const char *pszEnd)
     288static int i_portParseNumber(uint16_t *pu16Port, const char *pszStart, const char *pszEnd)
    296289{
    297290    /* Gets a string of digits, converts to 16 bit port number.
     
    321314}
    322315
    323 static int vrdpServerVerifyPortsString(Bstr ports)
    324 {
    325     com::Utf8Str portRange = ports;
    326 
     316static int i_vrdpServerVerifyPortsString(com::Utf8Str portRange)
     317{
    327318    const char *pszPortRange = portRange.c_str();
    328319
     
    363354        if (pszDash)
    364355        {
    365             rc = portParseNumber(NULL, pszStart, pszDash);
     356            rc = i_portParseNumber(NULL, pszStart, pszDash);
    366357            if (RT_SUCCESS(rc))
    367                 rc = portParseNumber(NULL, pszDash + 1, pszEnd);
     358                rc = i_portParseNumber(NULL, pszDash + 1, pszEnd);
    368359        }
    369360        else
    370             rc = portParseNumber(NULL, pszStart, pszEnd);
     361            rc = i_portParseNumber(NULL, pszStart, pszEnd);
    371362
    372363        if (RT_FAILURE(rc))
     
    377368}
    378369
    379 STDMETHODIMP VRDEServer::SetVRDEProperty(IN_BSTR aKey, IN_BSTR aValue)
     370HRESULT VRDEServer::setVRDEProperty(const com::Utf8Str &aKey, const com::Utf8Str &aValue)
    380371{
    381372    LogFlowThisFunc(("\n"));
    382 
    383     AutoCaller autoCaller(this);
    384     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    385373
    386374    /* the machine can also be in saved state for this property to change */
     
    395383    if (key == Bstr("TCP/Ports"))
    396384    {
    397         Bstr ports = aValue;
    398 
    399385        /* Verify the string. */
    400         int vrc = vrdpServerVerifyPortsString(ports);
     386        int vrc = i_vrdpServerVerifyPortsString(aValue);
    401387        if (RT_FAILURE(vrc))
    402388            return E_INVALIDARG;
    403389
    404         if (ports != mData->mProperties["TCP/Ports"])
     390        if (aValue != mData->mProperties["TCP/Ports"])
    405391        {
    406392            /* Port value is not verified here because it is up to VRDP transport to
     
    409395             */
    410396            mData.backup();
    411             if (ports == Bstr("0"))
     397            if (aValue == Utf8Str("0"))
    412398                mData->mProperties["TCP/Ports"] = VRDP_DEFAULT_PORT_STR;
    413399            else
    414                 mData->mProperties["TCP/Ports"] = ports;
     400                mData->mProperties["TCP/Ports"] = aValue;
    415401
    416402            /* leave the lock before informing callbacks */
     
    432418         * Look up the old value first; if nothing's changed then do nothing.
    433419         */
    434         Utf8Str strValue(aValue);
    435         Utf8Str strKey(aKey);
    436420        Utf8Str strOldValue;
    437421
    438         settings::StringsMap::const_iterator it = mData->mProperties.find(strKey);
     422        settings::StringsMap::const_iterator it = mData->mProperties.find(aKey);
    439423        if (it != mData->mProperties.end())
    440424            strOldValue = it->second;
    441425
    442         if (strOldValue != strValue)
    443         {
    444             if (strValue.isEmpty())
    445                 mData->mProperties.erase(strKey);
     426        if (strOldValue != aValue)
     427        {
     428            if (aValue.isEmpty())
     429                mData->mProperties.erase(aKey);
    446430            else
    447                 mData->mProperties[strKey] = strValue;
     431                mData->mProperties[aKey] = aValue;
    448432
    449433            /* leave the lock before informing callbacks */
     
    464448}
    465449
    466 STDMETHODIMP VRDEServer::GetVRDEProperty(IN_BSTR aKey, BSTR *aValue)
    467 {
    468     CheckComArgOutPointerValid(aValue);
    469 
    470     AutoCaller autoCaller(this);
    471     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    472 
    473     Bstr key = aKey;
    474     Bstr value;
    475 
     450HRESULT VRDEServer::getVRDEProperty(const com::Utf8Str &aKey, com::Utf8Str &aValue)
     451{
    476452    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    477 
    478     Utf8Str strKey(key);
    479     settings::StringsMap::const_iterator it = mData->mProperties.find(strKey);
     453    settings::StringsMap::const_iterator it = mData->mProperties.find(aKey);
    480454    if (it != mData->mProperties.end())
    481         value = it->second; // source is a Utf8Str
    482     else if (strKey == "TCP/Ports")
    483         value = VRDP_DEFAULT_PORT_STR;
    484     value.cloneTo(aValue);
     455        aValue = it->second; // source is a Utf8Str
     456    else if (aKey == "TCP/Ports")
     457        aValue = VRDP_DEFAULT_PORT_STR;
    485458
    486459    return S_OK;
     
    532505}
    533506
    534 STDMETHODIMP VRDEServer::COMGETTER(VRDEProperties)(ComSafeArrayOut(BSTR, aProperties))
    535 {
    536     if (ComSafeArrayOutIsNull(aProperties))
    537         return E_POINTER;
    538 
    539     AutoCaller autoCaller(this);
    540     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    541 
     507HRESULT VRDEServer::getVRDEProperties(std::vector<com::Utf8Str> &aProperties)
     508{
    542509    size_t cProperties = 0;
    543 
     510    aProperties.resize(0);
    544511    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    545512    if (!mData->mEnabled)
    546513    {
    547         com::SafeArray<BSTR> properties(cProperties);
    548         properties.detachTo(ComSafeArrayOutArg(aProperties));
     514        aProperties.resize(cProperties);
    549515        return S_OK;
    550516    }
     
    603569            Log(("VRDEPROP: %d properties\n", cProperties));
    604570
    605             com::SafeArray<BSTR> properties(cProperties);
    606 
    607571            if (cProperties > 0)
    608572            {
    609                 size_t i;
    610                 for (i = 0; papszNames[i] != NULL && i < cProperties; ++i)
     573                aProperties.resize(cProperties);
     574                for (size_t i = 0; papszNames[i] != NULL && i < cProperties; ++i)
    611575                {
    612                     Bstr tmp(papszNames[i]);
    613                     tmp.cloneTo(&properties[i]);
     576                     aProperties[i] = papszNames[i];
    614577                }
    615578            }
     
    618581            RTLdrClose(hmod);
    619582            hmod = NIL_RTLDRMOD;
    620 
    621             properties.detachTo(ComSafeArrayOutArg(aProperties));
    622583        }
    623584    }
     
    631592}
    632593
    633 STDMETHODIMP VRDEServer::COMGETTER(AuthType)(AuthType_T *aType)
    634 {
    635     CheckComArgOutPointerValid(aType);
    636 
    637     AutoCaller autoCaller(this);
    638     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    639 
     594
     595HRESULT VRDEServer::getAuthType(AuthType_T *aType)
     596{
    640597    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    641598
     
    645602}
    646603
    647 STDMETHODIMP VRDEServer::COMSETTER(AuthType)(AuthType_T aType)
    648 {
    649     AutoCaller autoCaller(this);
    650     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    651 
     604HRESULT VRDEServer::setAuthType(AuthType_T aType)
     605{
    652606    /* the machine can also be in saved state for this property to change */
    653607    AutoMutableOrSavedStateDependency adep(mParent);
     
    674628}
    675629
    676 STDMETHODIMP VRDEServer::COMGETTER(AuthTimeout)(ULONG *aTimeout)
    677 {
    678     CheckComArgOutPointerValid(aTimeout);
    679 
    680     AutoCaller autoCaller(this);
    681     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    682 
     630HRESULT VRDEServer::getAuthTimeout(ULONG *aTimeout)
     631{
    683632    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    684633
     
    688637}
    689638
    690 STDMETHODIMP VRDEServer::COMSETTER(AuthTimeout)(ULONG aTimeout)
    691 {
    692     AutoCaller autoCaller(this);
    693     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    694 
     639
     640HRESULT VRDEServer::setAuthTimeout(ULONG aTimeout)
     641{
    695642    /* the machine can also be in saved state for this property to change */
    696643    AutoMutableOrSavedStateDependency adep(mParent);
     
    721668}
    722669
    723 STDMETHODIMP VRDEServer::COMGETTER(AuthLibrary)(BSTR *aLibrary)
    724 {
    725     CheckComArgOutPointerValid(aLibrary);
    726 
    727     AutoCaller autoCaller(this);
    728     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    729 
    730     Bstr bstrLibrary;
    731 
     670HRESULT VRDEServer::getAuthLibrary(com::Utf8Str &aLibrary)
     671{
    732672    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    733     bstrLibrary = mData->mAuthLibrary;
     673    aLibrary = mData->mAuthLibrary;
    734674    alock.release();
    735675
    736     if (bstrLibrary.isEmpty())
     676    if (aLibrary.isEmpty())
    737677    {
    738678        /* Get the global setting. */
    739679        ComPtr<ISystemProperties> systemProperties;
    740680        HRESULT hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    741 
     681        Bstr strlib;
    742682        if (SUCCEEDED(hrc))
    743             hrc = systemProperties->COMGETTER(VRDEAuthLibrary)(bstrLibrary.asOutParam());
     683        {
     684            hrc = systemProperties->COMGETTER(VRDEAuthLibrary)(strlib.asOutParam());
     685            aLibrary = Utf8Str(strlib).c_str();
     686        }
    744687
    745688        if (FAILED(hrc))
     
    747690    }
    748691
    749     bstrLibrary.cloneTo(aLibrary);
    750 
    751     return S_OK;
    752 }
    753 
    754 STDMETHODIMP VRDEServer::COMSETTER(AuthLibrary)(IN_BSTR aLibrary)
    755 {
    756     AutoCaller autoCaller(this);
    757     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    758 
     692    return S_OK;
     693}
     694
     695
     696HRESULT VRDEServer::setAuthLibrary(const com::Utf8Str &aLibrary)
     697{
    759698    /* the machine can also be in saved state for this property to change */
    760699    AutoMutableOrSavedStateDependency adep(mParent);
    761700    if (FAILED(adep.rc())) return adep.rc();
    762701
    763     Bstr bstrLibrary(aLibrary);
    764 
    765702    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    766703
    767     if (mData->mAuthLibrary != bstrLibrary)
     704    if (mData->mAuthLibrary != aLibrary)
    768705    {
    769706        mData.backup();
    770         mData->mAuthLibrary = bstrLibrary;
     707        mData->mAuthLibrary = aLibrary;
    771708
    772709        /* leave the lock before informing callbacks */
     
    783720}
    784721
    785 STDMETHODIMP VRDEServer::COMGETTER(AllowMultiConnection)(BOOL *aAllowMultiConnection)
    786 {
    787     CheckComArgOutPointerValid(aAllowMultiConnection);
    788 
    789     AutoCaller autoCaller(this);
    790     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    791 
     722
     723HRESULT VRDEServer::getAllowMultiConnection(BOOL *aAllowMultiConnection)
     724{
    792725    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    793726
     
    797730}
    798731
    799 STDMETHODIMP VRDEServer::COMSETTER(AllowMultiConnection)(BOOL aAllowMultiConnection)
    800 {
    801     AutoCaller autoCaller(this);
    802     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    803 
     732
     733HRESULT VRDEServer::setAllowMultiConnection(BOOL aAllowMultiConnection)
     734{
    804735    /* the machine can also be in saved state for this property to change */
    805736    AutoMutableOrSavedStateDependency adep(mParent);
     
    826757}
    827758
    828 STDMETHODIMP VRDEServer::COMGETTER(ReuseSingleConnection)(BOOL *aReuseSingleConnection)
    829 {
    830     CheckComArgOutPointerValid(aReuseSingleConnection);
    831 
    832     AutoCaller autoCaller(this);
    833     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    834 
     759HRESULT VRDEServer::getReuseSingleConnection(BOOL *aReuseSingleConnection)
     760{
    835761    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    836762
     
    840766}
    841767
    842 STDMETHODIMP VRDEServer::COMSETTER(ReuseSingleConnection)(BOOL aReuseSingleConnection)
    843 {
    844     AutoCaller autoCaller(this);
    845     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    846 
    847     /* the machine can also be in saved state for this property to change */
     768
     769HRESULT VRDEServer::setReuseSingleConnection(BOOL aReuseSingleConnection)
     770{
    848771    AutoMutableOrSavedStateDependency adep(mParent);
    849772    if (FAILED(adep.rc())) return adep.rc();
     
    869792}
    870793
    871 STDMETHODIMP VRDEServer::COMGETTER(VRDEExtPack)(BSTR *aExtPack)
    872 {
    873     CheckComArgOutPointerValid(aExtPack);
    874 
    875     AutoCaller autoCaller(this);
    876     HRESULT hrc = autoCaller.rc();
     794HRESULT VRDEServer::getVRDEExtPack(com::Utf8Str &aExtPack)
     795{
     796    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     797    Utf8Str strExtPack = mData->mVrdeExtPack;
     798    alock.release();
     799    HRESULT hrc = S_OK;
     800
     801    if (strExtPack.isNotEmpty())
     802    {
     803        if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
     804            hrc = S_OK;
     805        else
     806        {
     807#ifdef VBOX_WITH_EXTPACK
     808            ExtPackManager *pExtPackMgr = mParent->getVirtualBox()->getExtPackManager();
     809            hrc = pExtPackMgr->checkVrdeExtPack(&strExtPack);
     810#else
     811            hrc = setError(E_FAIL, tr("Extension pack '%s' does not exist"), strExtPack.c_str());
     812#endif
     813        }
     814        if (SUCCEEDED(hrc))
     815            aExtPack = strExtPack;
     816    }
     817    else
     818    {
     819        /* Get the global setting. */
     820        BSTR bstr;
     821        ComPtr<ISystemProperties> systemProperties;
     822        hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
     823        if (SUCCEEDED(hrc))
     824            hrc = systemProperties->COMGETTER(DefaultVRDEExtPack)(&bstr);
     825        aExtPack = Utf8Str(bstr);
     826    }
     827    return hrc;
     828}
     829
     830// public methods only for internal purposes
     831/////////////////////////////////////////////////////////////////////////////
     832HRESULT VRDEServer::setVRDEExtPack(const com::Utf8Str &aExtPack)
     833{
     834    HRESULT hrc = S_OK;
     835    /* the machine can also be in saved state for this property to change */
     836    AutoMutableOrSavedStateDependency adep(mParent);
     837    hrc = adep.rc();
    877838    if (SUCCEEDED(hrc))
    878839    {
    879         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    880         Utf8Str strExtPack = mData->mVrdeExtPack;
    881         alock.release();
    882 
    883         if (strExtPack.isNotEmpty())
    884         {
    885             if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
     840        /*
     841         * If not empty, check the specific extension pack.
     842         */
     843        if (!aExtPack.isEmpty())
     844        {
     845            if (aExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
    886846                hrc = S_OK;
    887847            else
     
    889849#ifdef VBOX_WITH_EXTPACK
    890850                ExtPackManager *pExtPackMgr = mParent->getVirtualBox()->getExtPackManager();
    891                 hrc = pExtPackMgr->checkVrdeExtPack(&strExtPack);
     851                hrc = pExtPackMgr->checkVrdeExtPack(&aExtPack);
    892852#else
    893                 hrc = setError(E_FAIL, tr("Extension pack '%s' does not exist"), strExtPack.c_str());
     853                hrc = setError(E_FAIL, tr("Extension pack '%s' does not exist"), aExtPack.c_str());
    894854#endif
    895855            }
    896             if (SUCCEEDED(hrc))
    897                 strExtPack.cloneTo(aExtPack);
    898         }
    899         else
    900         {
    901             /* Get the global setting. */
    902             ComPtr<ISystemProperties> systemProperties;
    903             hrc = mParent->getVirtualBox()->COMGETTER(SystemProperties)(systemProperties.asOutParam());
    904             if (SUCCEEDED(hrc))
    905                 hrc = systemProperties->COMGETTER(DefaultVRDEExtPack)(aExtPack);
    906         }
    907     }
    908 
    909     return hrc;
    910 }
    911 
    912 STDMETHODIMP VRDEServer::COMSETTER(VRDEExtPack)(IN_BSTR aExtPack)
    913 {
    914     CheckComArgNotNull(aExtPack);
    915     Utf8Str strExtPack(aExtPack);
    916 
    917     AutoCaller autoCaller(this);
    918     HRESULT hrc = autoCaller.rc();
    919     if (SUCCEEDED(hrc))
    920     {
    921         /* the machine can also be in saved state for this property to change */
    922         AutoMutableOrSavedStateDependency adep(mParent);
    923         hrc = adep.rc();
     856        }
    924857        if (SUCCEEDED(hrc))
    925858        {
    926859            /*
    927              * If not empty, check the specific extension pack.
     860             * Update the setting if there is an actual change, post an
     861             * change event to trigger a VRDE server restart.
    928862             */
    929             if (!strExtPack.isEmpty())
    930             {
    931                 if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME))
    932                     hrc = S_OK;
    933                 else
    934                 {
    935 #ifdef VBOX_WITH_EXTPACK
    936                     ExtPackManager *pExtPackMgr = mParent->getVirtualBox()->getExtPackManager();
    937                     hrc = pExtPackMgr->checkVrdeExtPack(&strExtPack);
    938 #else
    939                     hrc = setError(E_FAIL, tr("Extension pack '%s' does not exist"), strExtPack.c_str());
    940 #endif
    941                 }
    942             }
    943             if (SUCCEEDED(hrc))
    944             {
    945                 /*
    946                  * Update the setting if there is an actual change, post an
    947                  * change event to trigger a VRDE server restart.
    948                  */
    949                 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    950                 if (strExtPack != mData->mVrdeExtPack)
    951                 {
    952                     mData.backup();
    953                     mData->mVrdeExtPack = strExtPack;
    954 
    955                     /* leave the lock before informing callbacks */
    956                     alock.release();
    957 
    958                     AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
    959                     mParent->setModified(Machine::IsModified_VRDEServer);
    960                     mlock.release();
    961 
    962                     mParent->onVRDEServerChange(/* aRestart */ TRUE);
    963                 }
     863             AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     864             if (aExtPack != mData->mVrdeExtPack)
     865             {
     866                 mData.backup();
     867                 mData->mVrdeExtPack = aExtPack;
     868
     869                /* leave the lock before informing callbacks */
     870                alock.release();
     871
     872                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);
     873                mParent->setModified(Machine::IsModified_VRDEServer);
     874                mlock.release();
     875
     876                mParent->onVRDEServerChange(/* aRestart */ TRUE);
    964877            }
    965878        }
     
    975888 *  @note Locks this object for writing.
    976889 */
    977 void VRDEServer::rollback()
     890void VRDEServer::i_rollback()
    978891{
    979892    /* sanity */
     
    990903 *  for writing) if there is one.
    991904 */
    992 void VRDEServer::commit()
     905void VRDEServer::i_commit()
    993906{
    994907    /* sanity */
     
    1019932 *  represented by @a aThat (locked for reading).
    1020933 */
    1021 void VRDEServer::copyFrom(VRDEServer *aThat)
     934void VRDEServer::i_copyFrom(VRDEServer *aThat)
    1022935{
    1023936    AssertReturnVoid(aThat != NULL);
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r49517 r49644  
    20492049         ++it)
    20502050    {
    2051         const Bstr &typeId = (*it)->id();
     2051        const Bstr &typeId = (*it)->i_id();
    20522052        AssertMsg(!typeId.isEmpty(), ("ID must not be NULL"));
    20532053        if (typeId.compare(aId, Bstr::CaseInsensitive) == 0)
     
    37193719         ++it)
    37203720    {
    3721         if ((*it)->id() == bstrOSType)
     3721        if ((*it)->i_id() == bstrOSType)
    37223722        {
    37233723            pGuestOSType = *it;
     
    42394239            {
    42404240                settings::DHCPServer d;
    4241                 rc = (*it)->saveSettings(d);
     4241                rc = (*it)->i_saveSettings(d);
    42424242                if (FAILED(rc)) throw rc;
    42434243                m->pMainConfigFile->llDhcpServers.push_back(d);
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r49517 r49644  
    104104NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Machine, IMachine)
    105105
    106 NS_DECL_CLASSINFO(VFSExplorer)
    107 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(VFSExplorer, IVFSExplorer)
    108 
    109106NS_DECL_CLASSINFO(Appliance)
    110107NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Appliance, IAppliance)
     
    137134NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SharedFolder, ISharedFolder)
    138135
    139 NS_DECL_CLASSINFO(VRDEServer)
    140 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(VRDEServer, IVRDEServer)
    141 
    142136NS_DECL_CLASSINFO(Host)
    143137NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Host, IHost)
     
    146140NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface)
    147141
    148 NS_DECL_CLASSINFO(DHCPServer)
    149 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(DHCPServer, IDHCPServer)
    150 
    151142NS_DECL_CLASSINFO(NATNetwork)
    152143NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NATNetwork, INATNetwork)
    153144
    154 NS_DECL_CLASSINFO(GuestOSType)
    155 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(GuestOSType, IGuestOSType)
    156 
    157145NS_DECL_CLASSINFO(NetworkAdapter)
    158146NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NetworkAdapter, INetworkAdapter)
     
    161149NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NATEngine, INATEngine)
    162150
    163 
    164 NS_DECL_CLASSINFO(SerialPort)
    165 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SerialPort, ISerialPort)
    166 
    167151NS_DECL_CLASSINFO(ParallelPort)
    168152NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ParallelPort, IParallelPort)
     
    173157NS_DECL_CLASSINFO(USBDeviceFilters)
    174158NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilters, IUSBDeviceFilters)
    175 
    176 NS_DECL_CLASSINFO(StorageController)
    177 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(StorageController, IStorageController)
    178159
    179160#ifdef VBOX_WITH_USB
     
    215196#endif
    216197
    217 NS_DECL_CLASSINFO(BandwidthGroup)
    218 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(BandwidthGroup, IBandwidthGroup)
    219 
    220 NS_DECL_CLASSINFO(BandwidthControl)
    221 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(BandwidthControl, IBandwidthControl)
    222198
    223199////////////////////////////////////////////////////////////////////////////////
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