VirtualBox

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


Ignore:
Timestamp:
Mar 16, 2016 7:43:56 PM (9 years ago)
Author:
vboxsync
Message:

Revert r106058, incomplete conversion of USBProxyBackend to a COM class failing to build on Windows

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r60067 r60068  
    86008600    uuid="afca788c-4477-787d-60b2-3fa70e56fbbc"
    86018601    wsmap="managed"
    8602     reservedMethods="0" reservedAttributes="12"
     8602    reservedMethods="2" reservedAttributes="12"
    86038603    >
    86048604    <desc>
     
    90629062      <desc>List of currently available host video capture devices.</desc>
    90639063    </attribute>
    9064 
    9065     <method name="addUSBDeviceSource">
    9066       <desc>
    9067         Adds a new USB device source.
    9068       </desc>
    9069       <param name="backend" type="wstring" dir="in">
    9070         <desc>The backend to use as the new device source.</desc>
    9071       </param>
    9072       <param name="id" type="wstring" dir="in">
    9073         <desc>Unique ID to identify the source.</desc>
    9074       </param>
    9075       <param name="address" type="wstring" dir="in">
    9076         <desc>
    9077           Address to use, the format is dependent on the backend.
    9078           For USB/IP backends for example the notation is host[:port].
    9079         </desc>
    9080       </param>
    9081       <param name="propertyNames" type="wstring" safearray="yes" dir="in">
    9082         <desc>Array of property names for more detailed configuration. Not used at the moment.</desc>
    9083       </param>
    9084       <param name="propertyValues" type="wstring" safearray="yes" dir="in">
    9085         <desc>Array of property values for more detailed configuration. Not used at the moment.</desc>
    9086       </param>
    9087     </method>
    9088 
    9089     <method name="removeUSBDeviceSource">
    9090       <desc>
    9091         Removes a previously added USB device source.
    9092       </desc>
    9093       <param name="id" type="wstring" dir="in">
    9094         <desc>The identifier used when the source was added.</desc>
    9095       </param>
    9096     </method>
    90979064
    90989065  </interface>
     
    1849318460        Action performed by the host when an attached USB device
    1849418461        matches this filter.
    18495       </desc>
    18496     </attribute>
    18497 
    18498   </interface>
    18499 
    18500 
    18501   <!--
    18502   // IUSBProxyBackend
    18503   /////////////////////////////////////////////////////////////////////////
    18504   -->
    18505 
    18506   <interface
    18507     name="IUSBProxyBackend" extends="$unknown"
    18508     uuid="dfe56449-6989-4002-80cf-3607f377d40c"
    18509     wsmap="managed"
    18510     reservedAttributes="8"
    18511     >
    18512     <desc>
    18513       The USBProxyBackend interface represents a source for USB devices available
    18514       to the host for attaching to the VM.
    18515     </desc>
    18516 
    18517     <attribute name="name" type="wstring" readonly="yes">
    18518       <desc>
    18519         The unique name of the proxy backend.
    18520       </desc>
    18521     </attribute>
    18522 
    18523     <attribute name="type" type="wstring" readonly="yes">
    18524       <desc>
    18525         The type of the backend.
    1852618462      </desc>
    1852718463    </attribute>
  • trunk/src/VBox/Main/include/HostImpl.h

    r60067 r60068  
    145145    HRESULT generateMACAddress(com::Utf8Str &aAddress);
    146146
    147     HRESULT addUSBDeviceSource(const com::Utf8Str &aBackend, const com::Utf8Str &aId, const com::Utf8Str &aAddress,
    148                                const std::vector<com::Utf8Str> &aPropertyNames, const std::vector<com::Utf8Str> &aPropertyValues);
    149 
    150     HRESULT removeUSBDeviceSource(const com::Utf8Str &aId);
    151 
    152147    // Internal Methods.
    153148
  • trunk/src/VBox/Main/include/USBProxyBackend.h

    r60067 r60068  
    3030#include "VirtualBoxImpl.h"
    3131#include "HostUSBDeviceImpl.h"
    32 #include "USBProxyBackendWrap.h"
    3332class USBProxyService;
    3433
     
    3736 */
    3837class USBProxyBackend
    39     : public USBProxyBackendWrap
    40 {
    41 public:
    42     USBProxyBackend(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    43     virtual int init(const com::Utf8Str &strAddress);
     38    : public VirtualBoxTranslatable
     39{
     40public:
     41    USBProxyBackend(USBProxyService *pUsbProxyService);
     42    virtual int init(void);
    4443    virtual ~USBProxyBackend();
    4544
     45    /**
     46     * Override of the default locking class to be used for validating lock
     47     * order with the standard member lock handle.
     48     */
     49    virtual VBoxLockingClass getLockingClass() const
     50    {
     51        // the USB proxy service uses the Host object lock, so return the
     52        // same locking class as the host
     53        return LOCKCLASS_HOSTOBJECT;
     54    }
     55
    4656    bool isActive(void);
    47     const com::Utf8Str &i_getId();
    48     uint32_t i_getRefCount();
     57
     58    RWLockHandle *lockHandle() const;
    4959
    5060    /** @name Interface for the USBController and the Host object.
     
    8696    virtual PUSBDEVICE getDevices(void);
    8797    bool updateDeviceStateFake(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine);
    88     uint32_t incRef();
    89     uint32_t decRef();
    9098
    9199    static HRESULT setError(HRESULT aResultCode, const char *aText, ...);
     
    96104private:
    97105
    98     // wrapped IUSBProxyBackend properties
    99     HRESULT getName(com::Utf8Str &aName);
    100     HRESULT getType(com::Utf8Str &aType);
    101 
    102106    static DECLCALLBACK(int) serviceThread(RTTHREAD Thread, void *pvUser);
    103107
    104108protected:
    105109    /** Pointer to the owning USB Proxy Service object. */
    106     USBProxyService   *m_pUsbProxyService;
     110    USBProxyService *m_pUsbProxyService;
    107111    /** Thread handle of the service thread. */
    108     RTTHREAD           mThread;
     112    RTTHREAD         mThread;
    109113    /** Flag which stop() sets to cause serviceThread to return. */
    110     bool volatile      mTerminate;
    111     /** Id of the instance. */
    112     const com::Utf8Str m_strId;
    113     /** Reference counter which prevents the backend instance from being removed. */
    114     uint32_t           m_cRefs;
     114    bool volatile    mTerminate;
    115115};
    116116
     
    130130{
    131131public:
    132     USBProxyBackendDarwin(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    133     int init(const com::Utf8Str &strAddress);
     132    USBProxyBackendDarwin(USBProxyService *pUsbProxyService);
     133    int init(void);
    134134    ~USBProxyBackendDarwin();
    135135
     
    179179{
    180180public:
    181     USBProxyBackendLinux(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    182     int init(const com::Utf8Str &strAddress);
     181    USBProxyBackendLinux(USBProxyService *pUsbProxyService);
     182    int init(void);
    183183    ~USBProxyBackendLinux();
    184184
     
    230230{
    231231public:
    232     USBProxyBackendOs2 (USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    233     /// @todo virtual int init(const com::Utf8Str &strAddress);
     232    USBProxyBackendOs2 (USBProxyService *pUsbProxyService);
     233    /// @todo virtual int init(void);
    234234    ~USBProxyBackendOs2();
    235235
     
    272272{
    273273public:
    274     USBProxyBackendSolaris(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    275     int init(const com::Utf8Str &strAddress);
     274    USBProxyBackendSolaris(USBProxyService *pUsbProxyService);
     275    int init(void);
    276276    ~USBProxyBackendSolaris();
    277277
     
    305305{
    306306public:
    307     USBProxyBackendWindows(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    308     int init(const com::Utf8Str &strAddress);
     307    USBProxyBackendWindows(USBProxyService *pUsbProxyService);
     308    int init(void);
    309309    ~USBProxyBackendWindows();
    310310
     
    334334{
    335335public:
    336     USBProxyBackendFreeBSD(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    337     int init(const com::Utf8Str &strAddress);
     336    USBProxyBackendFreeBSD(USBProxyService *pUsbProxyService);
     337    int init(void);
    338338    ~USBProxyBackendFreeBSD();
    339339
     
    369369    /** Waiting for the complete reception of a UsbIpExportedDevice structure. */
    370370    kUsbIpRecvState_ExportedDevice,
    371     /** Waiting for a complete reception of a UsbIpDeviceInterface structure to skip. */
     371    /** Waiting for a complete reception a UsbIpDeviceInterface strucutre to skip. */
    372372    kUsbIpRecvState_DeviceInterface,
    373373    /** 32bit hack. */
     
    385385{
    386386public:
    387     USBProxyBackendUsbIp(USBProxyService *pUsbProxyService, const com::Utf8Str &strId);
    388     int init(const com::Utf8Str &strAddress);
     387    USBProxyBackendUsbIp(USBProxyService *pUsbProxyService);
     388    int init(void);
    389389    ~USBProxyBackendUsbIp();
    390390
  • trunk/src/VBox/Main/include/USBProxyService.h

    r60067 r60068  
    5151    }
    5252
    53     void uninit(void);
    54 
    5553    bool isActive(void);
    5654    int getLastError(void);
     
    6765     * @{ */
    6866    HRESULT getDeviceCollection(std::vector<ComPtr<IHostUSBDevice> > &aUSBDevices);
    69     HRESULT addUSBDeviceSource(const com::Utf8Str &aBackend, const com::Utf8Str &aId, const com::Utf8Str &aAddress,
    70                                const std::vector<com::Utf8Str> &aPropertyNames, const std::vector<com::Utf8Str> &aPropertyValues);
    71     HRESULT removeUSBDeviceSource(const com::Utf8Str &aId);
    7267    /** @} */
    7368
     
    8378
    8479    void i_updateDeviceList(USBProxyBackend *pUsbProxyBackend, PUSBDEVICE pDevices);
    85     void i_getUSBFilters(USBDeviceFilterList *pGlobalFilters);
     80    void i_getUSBFilters(USBDeviceFilterList *pGlobalFiltes);
    8681
    8782protected:
     
    8984
    9085    static HRESULT setError(HRESULT aResultCode, const char *aText, ...);
    91 
    92     USBProxyBackend *findUsbProxyBackendById(const com::Utf8Str &strId);
    9386
    9487private:
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r60067 r60068  
    17041704
    17051705    return S_OK;
    1706 }
    1707 
    1708 HRESULT Host::addUSBDeviceSource(const com::Utf8Str &aBackend, const com::Utf8Str &aId, const com::Utf8Str &aAddress,
    1709                                  const std::vector<com::Utf8Str> &aPropertyNames, const std::vector<com::Utf8Str> &aPropertyValues)
    1710 {
    1711 #ifdef VBOX_WITH_USB
    1712     /* The USB proxy service will do the locking. */
    1713     return m->pUSBProxyService->addUSBDeviceSource(aBackend, aId, aAddress, aPropertyNames, aPropertyValues);
    1714 #else
    1715     ReturnComNotImplemented();
    1716 #endif
    1717 }
    1718 
    1719 HRESULT Host::removeUSBDeviceSource(const com::Utf8Str &aId)
    1720 {
    1721 #ifdef VBOX_WITH_USB
    1722     /* The USB proxy service will do the locking. */
    1723     return m->pUSBProxyService->removeUSBDeviceSource(aId);
    1724 #else
    1725     ReturnComNotImplemented();
    1726 #endif
    17271706}
    17281707
  • trunk/src/VBox/Main/src-server/USBProxyBackend.cpp

    r60067 r60068  
    3838 * Initialize data members.
    3939 */
    40 USBProxyBackend::USBProxyBackend(USBProxyService *pUsbProxyService, const com::Utf8Str &strId)
    41     : m_pUsbProxyService(pUsbProxyService), mThread(NIL_RTTHREAD), mTerminate(false), m_strId(strId),
    42       m_cRefs(0)
    43 {
    44     LogFlowThisFunc(("pUsbProxyService=%p strId=%s\n", pUsbProxyService, strId.c_str()));
     40USBProxyBackend::USBProxyBackend(USBProxyService *pUsbProxyService)
     41    : m_pUsbProxyService(pUsbProxyService), mThread(NIL_RTTHREAD), mTerminate(false)
     42{
     43    LogFlowThisFunc(("pUsbProxyService=%p\n", pUsbProxyService));
    4544}
    4645
     
    4948 * Stub needed as long as the class isn't virtual
    5049 */
    51 int USBProxyBackend::init(const com::Utf8Str &strAddress)
    52 {
    53     NOREF(strAddress);
     50int USBProxyBackend::init(void)
     51{
    5452    return VINF_SUCCESS;
    5553}
     
    8179
    8280/**
    83  * Returns the ID of the instance.
    84  *
    85  * @returns ID string for the instance.
    86  */
    87 const com::Utf8Str &USBProxyBackend::i_getId()
    88 {
    89     return m_strId;
    90 }
    91 
    92 
    93 /**
    94  * Returns the current reference counter for the backend.
    95  */
    96 uint32_t USBProxyBackend::i_getRefCount()
    97 {
    98     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    99     return m_cRefs;
     81 * We're using the Host object lock.
     82 *
     83 * This is just a temporary measure until all the USB refactoring is
     84 * done, probably... For now it help avoiding deadlocks we don't have
     85 * time to fix.
     86 *
     87 * @returns Lock handle.
     88 */
     89RWLockHandle *USBProxyBackend::lockHandle() const
     90{
     91    return m_pUsbProxyService->lockHandle();
    10092}
    10193
     
    133125    AssertReturn(!isWriteLockOnCurrentThread(), E_FAIL);
    134126    AssertReturn(!aDevice->isWriteLockOnCurrentThread(), E_FAIL);
    135 
    136     /*
    137      * Get the lists we'll iterate.
    138      */
    139     Host::USBDeviceFilterList globalFilters;
    140     m_pUsbProxyService->i_getUSBFilters(&globalFilters);
    141 
    142127    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    143128    AutoWriteLock devLock(aDevice COMMA_LOCKVAL_SRC_POS);
    144129    AssertMsgReturn(aDevice->i_isCapturableOrHeld(), ("{%s} %s\n", aDevice->i_getName().c_str(),
    145130                                                      aDevice->i_getStateName()), E_FAIL);
     131
     132    /*
     133     * Get the lists we'll iterate.
     134     */
     135    Host::USBDeviceFilterList globalFilters;
     136
     137    m_pUsbProxyService->i_getUSBFilters(&globalFilters);
    146138
    147139    /*
     
    316308    NOREF(aDevice);
    317309    NOREF(aSuccess);
    318 
    319     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    320     incRef();
    321310}
    322311
     
    361350    NOREF(aDevice);
    362351    NOREF(aSuccess);
    363 
    364     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    365     decRef();
    366352}
    367353
     
    444430        LogFlowThisFunc(("not active\n"));
    445431
    446     /* Make sure there is no device from us in the list anymore. */
    447     m_pUsbProxyService->i_updateDeviceList(this, NULL);
    448 
    449432    return rc;
    450433}
     
    638621}
    639622
    640 /**
    641  * Increments the reference counter.
    642  *
    643  * @returns New reference count value.
    644  */
    645 uint32_t USBProxyBackend::incRef()
    646 {
    647     Assert(isWriteLockOnCurrentThread());
    648 
    649     return ++m_cRefs;
    650 }
    651 
    652 /**
    653  * Decrements the reference counter.
    654  *
    655  * @returns New reference count value.
    656  */
    657 uint32_t USBProxyBackend::decRef()
    658 {
    659     Assert(isWriteLockOnCurrentThread());
    660 
    661     return --m_cRefs;
    662 }
    663623
    664624/**
     
    804764}
    805765
    806 HRESULT USBProxyBackend::getName(com::Utf8Str &aName)
    807 {
    808     /* strId is constant during life time, no need to lock */
    809     aName = m_strId;
    810     return S_OK;
    811 }
    812 
    813 HRESULT USBProxyBackend::getType(com::Utf8Str &aType)
    814 {
    815     aType = Utf8Str("");
    816     return S_OK;
     766
     767/*static*/
     768HRESULT USBProxyBackend::setError(HRESULT aResultCode, const char *aText, ...)
     769{
     770    va_list va;
     771    va_start(va, aText);
     772    HRESULT rc = VirtualBoxBase::setErrorInternal(aResultCode,
     773                                                    COM_IIDOF(IHost),
     774                                                    "USBProxyBackend",
     775                                                    Utf8StrFmt(aText, va),
     776                                                    false /* aWarning*/,
     777                                                    true /* aLogIt*/);
     778    va_end(va);
     779    return rc;
    817780}
    818781
  • trunk/src/VBox/Main/src-server/USBProxyService.cpp

    r60067 r60068  
    6767    USBProxyBackend *pUsbProxyBackendHost;
    6868# if defined(RT_OS_DARWIN)
    69     pUsbProxyBackendHost = new USBProxyBackendDarwin(this, Utf8Str("host"));
     69    pUsbProxyBackendHost = new USBProxyBackendDarwin(this);
    7070# elif defined(RT_OS_LINUX)
    71     pUsbProxyBackendHost = new USBProxyBackendLinux(this, Utf8Str("host"));
     71    pUsbProxyBackendHost = new USBProxyBackendLinux(this);
    7272# elif defined(RT_OS_OS2)
    73     pUsbProxyBackendHost = new USBProxyBackendOs2(this, Utf8Str("host"));
     73    pUsbProxyBackendHost = new USBProxyBackendOs2(this);
    7474# elif defined(RT_OS_SOLARIS)
    75     pUsbProxyBackendHost = new USBProxyBackendSolaris(this, Utf8Str("host"));
     75    pUsbProxyBackendHost = new USBProxyBackendSolaris(this);
    7676# elif defined(RT_OS_WINDOWS)
    77     pUsbProxyBackendHost = new USBProxyBackendWindows(this, Utf8Str("host"));
     77    pUsbProxyBackendHost = new USBProxyBackendWindows(this);
    7878# elif defined(RT_OS_FREEBSD)
    79     pUsbProxyBackendHost = new USBProxyBackendFreeBSD(this, Utf8Str("host"));
     79    pUsbProxyBackendHost = new USBProxyBackendFreeBSD(this);
    8080# else
    81     pUsbProxyBackendHost = new USBProxyBackend(this, Utf8Str("host"));
     81    pUsbProxyBackendHost = new USBProxyBackend(this);
    8282# endif
    83     int vrc = pUsbProxyBackendHost->init(Utf8Str(""));
     83    int vrc = pUsbProxyBackendHost->init();
    8484    if (RT_FAILURE(vrc))
    8585    {
     
    221221}
    222222
    223 
    224 HRESULT USBProxyService::addUSBDeviceSource(const com::Utf8Str &aBackend, const com::Utf8Str &aId, const com::Utf8Str &aAddress,
    225                                             const std::vector<com::Utf8Str> &aPropertyNames, const std::vector<com::Utf8Str> &aPropertyValues)
    226 {
    227     HRESULT hrc = S_OK;
    228 
    229     /* Check whether the ID is used first. */
    230     for (USBProxyBackendList::iterator it = mBackends.begin();
    231          it != mBackends.end();
    232          ++it)
    233     {
    234         USBProxyBackend *pUsbProxyBackend = *it;
    235 
    236         if (aId.equals(pUsbProxyBackend->i_getId()))
    237             return setError(VBOX_E_OBJECT_IN_USE,
    238                             tr("The USB device source \"%s\" exists already"), aId.c_str());
    239     }
    240 
    241     /* Create appropriate proxy backend. */
    242     if (aBackend.equalsIgnoreCase("USBIP"))
    243     {
    244         USBProxyBackend *pUsbProxyBackend = new USBProxyBackendUsbIp(this, aId);
    245 
    246         int vrc = pUsbProxyBackend->init(aAddress);
    247         if (RT_FAILURE(vrc))
    248         {
    249             delete pUsbProxyBackend;
    250             mLastError = vrc;
    251         }
    252         else
    253             mBackends.push_back(pUsbProxyBackend);
    254     }
    255     else
    256         hrc = setError(VBOX_E_OBJECT_NOT_FOUND,
    257                        tr("The USB backend \"%s\" is not supported"), aBackend.c_str());
    258 
    259     return hrc;
    260 }
    261 
    262 HRESULT USBProxyService::removeUSBDeviceSource(const com::Utf8Str &aId)
    263 {
    264     for (USBProxyBackendList::iterator it = mBackends.begin();
    265          it != mBackends.end();
    266          ++it)
    267     {
    268         USBProxyBackend *pUsbProxyBackend = *it;
    269 
    270         if (aId.equals(pUsbProxyBackend->i_getId()))
    271         {
    272             mBackends.erase(it);
    273             delete pUsbProxyBackend;
    274             return S_OK;
    275         }
    276     }
    277 
    278     return setError(VBOX_E_OBJECT_NOT_FOUND,
    279                     tr("The USB device source \"%s\" could not be found"), aId.c_str());
    280 }
    281223
    282224/**
  • trunk/src/VBox/Main/src-server/darwin/USBProxyBackendDarwin.cpp

    r60067 r60068  
    2020*   Header Files                                                                                                                 *
    2121*********************************************************************************************************************************/
    22 #define LOG_GROUP LOG_GROUP_MAIN
    2322#include "USBProxyBackend.h"
    2423#include "Logging.h"
     
    4039 * Initialize data members.
    4140 */
    42 USBProxyBackendDarwin::USBProxyBackendDarwin(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    43     : USBProxyBackend(aUsbProxyService, strId), mServiceRunLoopRef(NULL), mNotifyOpaque(NULL), mWaitABitNextTime(false), mUSBLibInitialized(false)
     41USBProxyBackendDarwin::USBProxyBackendDarwin(USBProxyService *aUsbProxyService)
     42    : USBProxyBackend(aUsbProxyService), mServiceRunLoopRef(NULL), mNotifyOpaque(NULL), mWaitABitNextTime(false), mUSBLibInitialized(false)
    4443{
    4544    LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService));
     
    5251 * @returns VBox status code.
    5352 */
    54 int USBProxyBackendDarwin::init(const com::Utf8Str &strAddress)
    55 {
    56     NOREF(strAddress);
    57 
     53int USBProxyBackendDarwin::init(void)
     54{
    5855    /*
    5956     * Initialize the USB library.
     
    158155        USBLibRemoveFilter(aDevice->i_getBackendUserData());
    159156    aDevice->i_setBackendUserData(NULL);
    160     USBProxyBackend::captureDeviceCompleted(aDevice, aSuccess);
    161157}
    162158
     
    213209        USBLibRemoveFilter(aDevice->i_getBackendUserData());
    214210    aDevice->i_setBackendUserData(NULL);
    215     USBProxyBackend::releaseDeviceCompleted(aDevice, aSuccess);
    216211}
    217212
  • trunk/src/VBox/Main/src-server/freebsd/USBProxyBackendFreeBSD.cpp

    r60067 r60068  
    6060 * Initialize data members.
    6161 */
    62 USBProxyBackendFreeBSD::USBProxyBackendFreeBSD(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    63     : USBProxyBackend(aUsbProxyService, strId)
     62USBProxyBackendFreeBSD::USBProxyBackendFreeBSD(USBProxyService *aUsbProxyService)
     63    : USBProxyBackend(aHost)
    6464{
    6565    LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService));
     
    7272 * @returns S_OK on success and non-fatal failures, some COM error otherwise.
    7373 */
    74 int USBProxyBackendFreeBSD::init(const com::Utf8Str &strAddress)
    75 {
    76     NOREF(strAddress);
    77 
     74int USBProxyBackendFreeBSD::init(void)
     75{
    7876    /*
    7977     * Create semaphore.
  • trunk/src/VBox/Main/src-server/generic/USBProxyBackendUsbIp.cpp

    r60067 r60068  
    265265 * Initialize data members.
    266266 */
    267 USBProxyBackendUsbIp::USBProxyBackendUsbIp(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    268     : USBProxyBackend(aUsbProxyService, strId)
     267USBProxyBackendUsbIp::USBProxyBackendUsbIp(USBProxyService *aUsbProxyService)
     268    : USBProxyBackend(aUsbProxyService)
    269269{
    270270    LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService));
     
    276276 * @returns S_OK on success and non-fatal failures, some COM error otherwise.
    277277 */
    278 int USBProxyBackendUsbIp::init(const com::Utf8Str &strAddress)
     278int USBProxyBackendUsbIp::init(void)
    279279{
    280280    int rc = VINF_SUCCESS;
     
    282282    m = new Data;
    283283
    284     /* Split address into hostname and port. */
    285     RTCList<RTCString> lstAddress = strAddress.split(":");
    286     if (lstAddress.size() < 1)
    287         return VERR_INVALID_PARAMETER;
    288     m->pszHost = RTStrDup(lstAddress[0].c_str());
    289     if (!m->pszHost)
    290         return VERR_NO_STR_MEMORY;
    291     if (lstAddress.size() == 2)
    292     {
    293         m->uPort = lstAddress[1].toUInt32();
    294         if (!m->uPort)
    295             return VERR_INVALID_PARAMETER;
    296     }
     284    /** @todo: Pass in some config like host and port to connect to. */
    297285
    298286    /* Setup wakeup pipe and poll set first. */
  • trunk/src/VBox/Main/src-server/linux/USBProxyBackendLinux.cpp

    r60067 r60068  
    6060 * Initialize data members.
    6161 */
    62 USBProxyBackendLinux::USBProxyBackendLinux(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    63     : USBProxyBackend(aUsbProxyService, strId), mhFile(NIL_RTFILE), mhWakeupPipeR(NIL_RTPIPE),
     62USBProxyBackendLinux::USBProxyBackendLinux(USBProxyService *aUsbProxyService)
     63    : USBProxyBackend(aUsbProxyService), mhFile(NIL_RTFILE), mhWakeupPipeR(NIL_RTPIPE),
    6464      mhWakeupPipeW(NIL_RTPIPE), mUsingUsbfsDevices(true /* see init */),
    6565      mUdevPolls(0), mpWaiter(NULL)
     
    7373 * @returns VBox status code.
    7474 */
    75 int USBProxyBackendLinux::init(const com::Utf8Str &strAddress)
    76 {
    77     NOREF(strAddress);
    78 
     75int USBProxyBackendLinux::init(void)
     76{
    7977    const char *pcszDevicesRoot;
    8078    int rc = USBProxyLinuxChooseMethod(&mUsingUsbfsDevices, &pcszDevicesRoot);
  • trunk/src/VBox/Main/src-server/os2/USBProxyBackendOs2.cpp

    r60067 r60068  
    3838 * Initialize data members.
    3939 */
    40 USBProxyBackendOs2::USBProxyBackendOs2(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    41     : USBProxyBackend(aUsbProxyService, strId), mhev(NULLHANDLE), mhmod(NULLHANDLE),
     40USBProxyBackendOs2::USBProxyBackendOs2(USBProxyService *aUsbProxyService)
     41    : USBProxyBackend(aUsbProxyService), mhev(NULLHANDLE), mhmod(NULLHANDLE),
    4242    mpfnUsbRegisterChangeNotification(NULL), mpfnUsbDeregisterNotification(NULL),
    4343    mpfnUsbQueryNumberDevices(NULL), mpfnUsbQueryDeviceReport(NULL)
  • trunk/src/VBox/Main/src-server/solaris/USBProxyBackendSolaris.cpp

    r60067 r60068  
    5555 * Initialize data members.
    5656 */
    57 USBProxyBackendSolaris::USBProxyBackendSolaris(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    58     : USBProxyBackend(aUsbProxyService, strId), mUSBLibInitialized(false)
     57USBProxyBackendSolaris::USBProxyBackendSolaris(USBProxyService *aUsbProxyService)
     58    : USBProxyBackend(aUsbProxyService), mUSBLibInitialized(false)
    5959{
    6060    LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService));
     
    6767 * @returns VBox status code.
    6868 */
    69 int USBProxyBackendSolaris::init(const com::Utf8Str &strAddress)
    70 {
    71     NOREF(strAddress);
    72 
     69int USBProxyBackendSolaris::init(void)
     70{
    7371    /*
    7472     * Create semaphore.
     
    386384        USBLibRemoveFilter(aDevice->i_getBackendUserData());
    387385    aDevice->i_setBackendUserData(NULL);
    388     USBProxyBackend::captureDeviceCompleted(aDevice, aSuccess);
    389386}
    390387
     
    442439        USBLibRemoveFilter(aDevice->i_getBackendUserData());
    443440    aDevice->i_setBackendUserData(NULL);
    444     USBProxyBackend::releaseDeviceCompleted(aDevice, aSuccess);
    445441}
    446442
  • trunk/src/VBox/Main/src-server/win/USBProxyBackendWindows.cpp

    r60067 r60068  
    3838 * Initialize data members.
    3939 */
    40 USBProxyBackendWindows::USBProxyBackendWindows(USBProxyService *aUsbProxyService, const com::Utf8Str &strId)
    41     : USBProxyBackend(aUsbProxyService, strId), mhEventInterrupt(INVALID_HANDLE_VALUE)
     40USBProxyBackendWindows::USBProxyBackendWindows(USBProxyService *aUsbProxyService)
     41    : USBProxyBackend(aUsbProxyService), mhEventInterrupt(INVALID_HANDLE_VALUE)
    4242{
    4343    LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService));
     
    5050 * @returns S_OK on success and non-fatal failures, some COM error otherwise.
    5151 */
    52 int USBProxyBackendWindows::init(const com::Utf8Str &strAddress)
    53 {
    54     NOREF(strAddress);
    55 
     52int USBProxyBackendWindows::init(void)
     53{
    5654    /*
    5755     * Create the semaphore (considered fatal).
  • trunk/src/VBox/Main/testcase/Makefile.kmk

    r60067 r60068  
    208208tstUSBProxyLinux_SOURCES   = \
    209209        tstUSBProxyLinux.cpp \
     210        ../src-server/linux/USBProxyBackendLinux.cpp \
    210211        ../src-server/linux/USBGetDevices.cpp
    211212tstUSBProxyLinux_INCS      = \
  • trunk/src/VBox/Main/testcase/tstUSBProxyLinux.cpp

    r60067 r60068  
    2121*********************************************************************************************************************************/
    2222
     23#include "USBProxyBackend.h"
    2324#include "USBGetDevices.h"
    2425
     
    3031
    3132/*** BEGIN STUBS ***/
     33
     34USBProxyBackend::USBProxyBackend(USBProxyService*) {}
     35USBProxyBackend::~USBProxyBackend() {}
     36int USBProxyBackend::init() { return VINF_SUCCESS; }
     37int USBProxyBackend::start() { return VINF_SUCCESS; }
     38int USBProxyBackend::stop() { return VINF_SUCCESS; }
     39RWLockHandle *USBProxyBackend::lockHandle() const { return NULL; }
     40void *USBProxyBackend::insertFilter(USBFILTER const*) { return NULL; }
     41void USBProxyBackend::removeFilter(void*) {}
     42int USBProxyBackend::captureDevice(HostUSBDevice*) { return VINF_SUCCESS; }
     43void USBProxyBackend::captureDeviceCompleted(HostUSBDevice*, bool) {}
     44void USBProxyBackend::detachingDevice(HostUSBDevice*) {}
     45int USBProxyBackend::releaseDevice(HostUSBDevice*) { return VINF_SUCCESS; }
     46void USBProxyBackend::releaseDeviceCompleted(HostUSBDevice*, bool) {}
     47void USBProxyBackend::serviceThreadInit() {}
     48void USBProxyBackend::serviceThreadTerm() {}
     49int USBProxyBackend::wait(unsigned int) { return VINF_SUCCESS; }
     50int USBProxyBackend::interruptWait() { return VINF_SUCCESS; }
     51PUSBDEVICE USBProxyBackend::getDevices() { return NULL; }
     52void USBProxyBackend::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, PUSBDEVICE aUSBDevice) {}
     53void USBProxyBackend::deviceRemoved(ComObjPtr<HostUSBDevice> &aDevice) {}
     54void USBProxyBackend::deviceChanged(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList*, SessionMachine*) {}
     55bool USBProxyBackend::updateDeviceState(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
     56bool USBProxyBackend::updateDeviceStateFake(HostUSBDevice*, USBDEVICE*, bool*, SessionMachine**) { return true; }
     57bool USBProxyBackend::isActive() { return true; }
     58
     59VBoxMainHotplugWaiter::VBoxMainHotplugWaiter(char const*) {}
     60
     61com::Utf8Str HostUSBDevice::i_getName()
     62{
     63    return Utf8Str();
     64}
     65
     66void SysFreeString(BSTR bstr)
     67{
     68    Assert(0);
     69}
    3270
    3371static struct
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