VirtualBox

Changeset 7964 in vbox


Ignore:
Timestamp:
Apr 14, 2008 5:56:52 PM (17 years ago)
Author:
vboxsync
Message:

Attempt at making OSE build again.

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

Legend:

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

    r7944 r7964  
     1/* $Id$ */
    12/** @file
    2  * VirtualBox COM class implementation
     3 * VirtualBox COM class implementation: Host
    34 */
    45
     
    7374#include "HostDVDDriveImpl.h"
    7475#include "HostFloppyDriveImpl.h"
    75 #include "HostUSBDeviceImpl.h"
    76 #include "USBDeviceFilterImpl.h"
    77 #include "USBProxyService.h"
     76#ifdef VBOX_WITH_USB
     77# include "HostUSBDeviceImpl.h"
     78# include "USBDeviceFilterImpl.h"
     79# include "USBProxyService.h"
     80#endif
    7881#include "VirtualBoxImpl.h"
    7982#include "MachineImpl.h"
     
    8184
    8285#ifdef RT_OS_DARWIN
    83 #include "darwin/iokit.h"
     86# include "darwin/iokit.h"
    8487#endif
    8588
    8689#ifdef RT_OS_WINDOWS
    87 #include "HostNetworkInterfaceImpl.h"
     90# include "HostNetworkInterfaceImpl.h"
    8891#endif
    8992
     
    145148#elif defined (RT_OS_WINDOWS) && defined (VBOX_WITH_USB)
    146149    mUSBProxyService = new USBProxyServiceWin32 (this);
    147 #else
     150#elif defined (VBOX_WITH_USB)
    148151    mUSBProxyService = new USBProxyService (this);
    149152#endif
     
    166169    AssertReturn (isReady(), (void) 0);
    167170
     171#ifdef VBOX_WITH_USB
    168172    /* wait for USB proxy service to terminate before we uninit all USB
    169173     * devices */
    170174    LogFlowThisFunc (("Stopping USB proxy service...\n"));
    171175    delete mUSBProxyService;
     176    mUSBProxyService = NULL;
    172177    LogFlowThisFunc (("Done stopping USB proxy service.\n"));
    173     mUSBProxyService = NULL;
     178#endif
    174179
    175180    /* uninit all USB device filters still referenced by clients */
    176181    uninitDependentChildren();
    177182
     183#ifdef VBOX_WITH_USB
    178184    mUSBDeviceFilters.clear();
    179185    mUSBDevices.clear();
     186#endif
    180187
    181188    setReady (FALSE);
     
    10711078////////////////////////////////////////////////////////////////////////////////
    10721079
    1073 /**
    1074  *  Called by setter methods of all USB device filters.
    1075  */
    1076 HRESULT Host::onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter,
    1077                                        BOOL aActiveChanged /* = FALSE */)
    1078 {
    1079     AutoLock alock (this);
    1080     CHECK_READY();
    1081 
    1082     if (aFilter->mInList)
    1083     {
    1084         if (aActiveChanged)
    1085         {
    1086             // insert/remove the filter from the proxy
    1087             if (aFilter->data().mActive)
    1088             {
    1089                 ComAssertRet (aFilter->id() == NULL, E_FAIL);
    1090                 aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
    1091             }
    1092             else
    1093             {
    1094                 ComAssertRet (aFilter->id() != NULL, E_FAIL);
    1095                 mUSBProxyService->removeFilter (aFilter->id());
    1096                 aFilter->id() = NULL;
    1097             }
    1098         }
    1099         else
    1100         {
    1101             if (aFilter->data().mActive)
    1102             {
    1103                 // update the filter in the proxy
    1104                 ComAssertRet (aFilter->id() != NULL, E_FAIL);
    1105                 mUSBProxyService->removeFilter (aFilter->id());
    1106                 aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
    1107             }
    1108         }
    1109 
    1110         // save the global settings... yeah, on every single filter property change
    1111         alock.unlock();
    1112         return mParent->saveSettings();
    1113     }
    1114 
    1115     return S_OK;
    1116 }
    1117 
    11181080HRESULT Host::loadSettings (const settings::Key &aGlobal)
    11191081{
     
    11271089    HRESULT rc = S_OK;
    11281090
     1091#ifdef VBOX_WITH_USB
    11291092    Key::List filters = aGlobal.key ("USBDeviceFilters").keys ("DeviceFilter");
    11301093    for (Key::List::const_iterator it = filters.begin();
     
    11721135        }
    11731136    }
     1137#endif /* VBOX_WITH_USB */
    11741138
    11751139    return rc;
     
    11851149    ComAssertRet (!aGlobal.isNull(), E_FAIL);
    11861150
     1151#ifdef VBOX_WITH_USB
    11871152    /* first, delete the entry */
    11881153    Key filters = aGlobal.findKey ("USBDeviceFilters");
     
    12451210        ++ it;
    12461211    }
     1212#endif /* VBOX_WITH_USB */
    12471213
    12481214    return S_OK;
    12491215}
     1216
     1217#ifdef VBOX_WITH_USB
     1218
     1219/**
     1220 *  Called by setter methods of all USB device filters.
     1221 */
     1222HRESULT Host::onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter,
     1223                                       BOOL aActiveChanged /* = FALSE */)
     1224{
     1225    AutoLock alock (this);
     1226    CHECK_READY();
     1227
     1228    if (aFilter->mInList)
     1229    {
     1230        if (aActiveChanged)
     1231        {
     1232            // insert/remove the filter from the proxy
     1233            if (aFilter->data().mActive)
     1234            {
     1235                ComAssertRet (aFilter->id() == NULL, E_FAIL);
     1236                aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
     1237            }
     1238            else
     1239            {
     1240                ComAssertRet (aFilter->id() != NULL, E_FAIL);
     1241                mUSBProxyService->removeFilter (aFilter->id());
     1242                aFilter->id() = NULL;
     1243            }
     1244        }
     1245        else
     1246        {
     1247            if (aFilter->data().mActive)
     1248            {
     1249                // update the filter in the proxy
     1250                ComAssertRet (aFilter->id() != NULL, E_FAIL);
     1251                mUSBProxyService->removeFilter (aFilter->id());
     1252                aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
     1253            }
     1254        }
     1255
     1256        // save the global settings... yeah, on every single filter property change
     1257        alock.unlock();
     1258        return mParent->saveSettings();
     1259    }
     1260
     1261    return S_OK;
     1262}
     1263
    12501264
    12511265/**
     
    15021516    return S_OK;
    15031517}
     1518
     1519#endif /* VBOX_HOST_USB */
    15041520
    15051521// private methods
     
    19852001#endif // RT_OS_LINUX || RT_OS_SOLARIS
    19862002
     2003#ifdef VBOX_WITH_USB
     2004
    19872005/**
    19882006 *  Applies all (golbal and VM) filters to the given USB device. The device
     
    22602278    }
    22612279}
     2280#endif /* VBOX_WITH_USB */
    22622281
    22632282/**
  • trunk/src/VBox/Main/MachineImpl.cpp

    r7611 r7964  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VirtualBox COM class implementation
     3 * Implementation of IMachine in VBoxSVC.
    44 */
    55
     
    4242#include "SATAControllerImpl.h"
    4343
    44 #include "USBProxyService.h"
     44#ifdef VBOX_WITH_USB
     45# include "USBProxyService.h"
     46#endif
    4547
    4648#include "VirtualBoxXMLUtil.h"
     
    75287530    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    75297531
     7532#ifdef VBOX_WITH_USB
    75307533    *aMatched = mUSBController->hasMatchingFilter (aUSBDevice, aMaskedIfs);
     7534#else
     7535    *aMatched = FALSE;
     7536#endif
    75317537
    75327538    return S_OK;
     
    75437549    AssertComRCReturnRC (autoCaller.rc());
    75447550
     7551#ifdef VBOX_WITH_USB
    75457552    /* if cautureUSBDevice() fails, it must have set extended error info */
    75467553    return mParent->host()->captureUSBDevice (this, aId);
     7554#else
     7555    return E_FAIL;
     7556#endif
    75477557}
    75487558
     
    75577567    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    75587568
     7569#ifdef VBOX_WITH_USB
    75597570    return mParent->host()->detachUSBDevice (this, aId, aDone);
     7571#else
     7572    return E_FAIL;
     7573#endif
    75607574}
    75617575
     
    75757589    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    75767590
     7591#ifdef VBOX_WITH_USB
    75777592    HRESULT rc = mUSBController->notifyProxy (true /* aInsertFilters */);
    75787593    AssertComRC (rc);
     
    75807595
    75817596    return mParent->host()->autoCaptureUSBDevices (this);
     7597#else
     7598    return S_OK;
     7599#endif
    75827600}
    75837601
     
    75997617    AssertComRCReturn (autoCaller.rc(), autoCaller.rc());
    76007618
     7619#ifdef VBOX_WITH_USB
    76017620    HRESULT rc = mUSBController->notifyProxy (false /* aInsertFilters */);
    76027621    AssertComRC (rc);
     
    76047623
    76057624    return mParent->host()->detachAllUSBDevices (this, aDone);
     7625#else
     7626    return S_OK;
     7627#endif
    76067628}
    76077629
     
    85348556    AutoReaderLock alock (this);
    85358557
     8558#ifdef VBOX_WITH_USB
    85368559    return mUSBController->hasMatchingFilter (aDevice, aMaskedIfs);
     8560#else
     8561    return false;
     8562#endif
    85378563}
    85388564
  • trunk/src/VBox/Main/Makefile.kmk

    r7852 r7964  
    178178        Logging.cpp \
    179179        Matching.cpp \
    180         USBDeviceFilterImpl.cpp \
    181         USBProxyService.cpp \
    182180        VirtualBoxBase.cpp \
    183181        VirtualBoxErrorInfoImpl.cpp \
     
    196194        HostDVDDriveImpl.cpp \
    197195        HostFloppyDriveImpl.cpp \
    198         HostUSBDeviceImpl.cpp \
    199196        GuestOSTypeImpl.cpp \
    200197        NetworkAdapterImpl.cpp \
     
    233230
    234231ifdef VBOX_WITH_USB
     232VBoxSVC_SOURCES  += \
     233        USBDeviceFilterImpl.cpp \
     234        USBProxyService.cpp \
     235        HostUSBDeviceImpl.cpp
    235236VBoxSVC_SOURCES.darwin  +=  darwin/USBProxyServiceDarwin.cpp
    236237VBoxSVC_SOURCES.linux   +=   linux/USBProxyServiceLinux.cpp
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r7852 r7964  
     1/* $Id$ */
    12/** @file
    2  *
    33 * Implementation of IUSBController.
    44 */
     
    2222#include "VirtualBoxImpl.h"
    2323#include "HostImpl.h"
    24 #include "USBDeviceImpl.h"
    25 #include "HostUSBDeviceImpl.h"
     24#ifdef VBOX_WITH_USB
     25# include "USBDeviceImpl.h"
     26# include "HostUSBDeviceImpl.h"
     27# include "USBProxyService.h"
     28#endif
    2629#include "Logging.h"
    2730
    28 #include "USBProxyService.h"
    2931
    3032#include <iprt/string.h>
     
    7577
    7678    mData.allocate();
     79#ifdef VBOX_WITH_USB
    7780    mDeviceFilters.allocate();
     81#endif
    7882
    7983    /* Confirm a successful initialization */
     
    112116    mData.share (aPeer->mData);
    113117
     118#ifdef VBOX_WITH_USB
    114119    /* create copies of all filters */
    115120    mDeviceFilters.allocate();
     
    123128        ++ it;
    124129    }
     130#endif /* VBOX_WITH_USB */
    125131
    126132    /* Confirm a successful initialization */
     
    152158    mData.attachCopy (aPeer->mData);
    153159
     160#ifdef VBOX_WITH_USB
    154161    /* create private copies of all filters */
    155162    mDeviceFilters.allocate();
     
    163170        ++ it;
    164171    }
     172#endif /* VBOX_WITH_USB */
    165173
    166174    /* Confirm a successful initialization */
     
    187195    uninitDependentChildren();
    188196
     197#ifdef VBOX_WITH_USB
    189198    mDeviceFilters.free();
     199#endif
    190200    mData.free();
    191201
     
    293303    /* not accessing data -- no need to lock */
    294304
    295     /** Note: This is no longer correct */
     305    /** @todo This is no longer correct */
    296306    *aUSBStandard = 0x0101;
    297307
    298308    return S_OK;
    299309}
     310
     311#ifndef VBOX_WITH_USB
     312/**
     313 * Fake class for build without USB.
     314 * We need an empty collection & enum for deviceFilters, that's all.
     315 */
     316class ATL_NO_VTABLE USBDeviceFilter : public VirtualBoxBaseNEXT, public IUSBDeviceFilter
     317{
     318public:
     319    DECLARE_NOT_AGGREGATABLE(USBDeviceFilter)
     320    DECLARE_PROTECT_FINAL_CONSTRUCT()
     321    BEGIN_COM_MAP(USBDeviceFilter)
     322        COM_INTERFACE_ENTRY(ISupportErrorInfo)
     323        COM_INTERFACE_ENTRY(IUSBDeviceFilter)
     324    END_COM_MAP()
     325
     326    NS_DECL_ISUPPORTS
     327
     328    DECLARE_EMPTY_CTOR_DTOR (USBDeviceFilter)
     329
     330    // IUSBDeviceFilter properties
     331    STDMETHOD(COMGETTER(Name)) (BSTR *aName);
     332    STDMETHOD(COMSETTER(Name)) (INPTR BSTR aName);
     333    STDMETHOD(COMGETTER(Active)) (BOOL *aActive);
     334    STDMETHOD(COMSETTER(Active)) (BOOL aActive);
     335    STDMETHOD(COMGETTER(VendorId)) (BSTR *aVendorId);
     336    STDMETHOD(COMSETTER(VendorId)) (INPTR BSTR aVendorId);
     337    STDMETHOD(COMGETTER(ProductId)) (BSTR *aProductId);
     338    STDMETHOD(COMSETTER(ProductId)) (INPTR BSTR aProductId);
     339    STDMETHOD(COMGETTER(Revision)) (BSTR *aRevision);
     340    STDMETHOD(COMSETTER(Revision)) (INPTR BSTR aRevision);
     341    STDMETHOD(COMGETTER(Manufacturer)) (BSTR *aManufacturer);
     342    STDMETHOD(COMSETTER(Manufacturer)) (INPTR BSTR aManufacturer);
     343    STDMETHOD(COMGETTER(Product)) (BSTR *aProduct);
     344    STDMETHOD(COMSETTER(Product)) (INPTR BSTR aProduct);
     345    STDMETHOD(COMGETTER(SerialNumber)) (BSTR *aSerialNumber);
     346    STDMETHOD(COMSETTER(SerialNumber)) (INPTR BSTR aSerialNumber);
     347    STDMETHOD(COMGETTER(Port)) (BSTR *aPort);
     348    STDMETHOD(COMSETTER(Port)) (INPTR BSTR aPort);
     349    STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote);
     350    STDMETHOD(COMSETTER(Remote)) (INPTR BSTR aRemote);
     351    STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs);
     352    STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs);
     353};
     354COM_DECL_READONLY_ENUM_AND_COLLECTION (USBDeviceFilter);
     355COM_IMPL_READONLY_ENUM_AND_COLLECTION (USBDeviceFilter);
     356#endif /* !VBOX_WITH_USB */
     357
    300358
    301359STDMETHODIMP USBController::COMGETTER(DeviceFilters) (IUSBDeviceFilterCollection **aDevicesFilters)
     
    311369    ComObjPtr <USBDeviceFilterCollection> collection;
    312370    collection.createObject();
     371#ifdef VBOX_WITH_USB
    313372    collection->init (*mDeviceFilters.data());
     373#endif
    314374    collection.queryInterfaceTo (aDevicesFilters);
    315375
     
    323383                                                IUSBDeviceFilter **aFilter)
    324384{
     385#ifdef VBOX_WITH_USB
    325386    if (!aFilter)
    326387        return E_POINTER;
     
    346407
    347408    return S_OK;
     409#else
     410    return E_NOTIMPL;
     411#endif
    348412}
    349413
     
    351415                                                IUSBDeviceFilter *aFilter)
    352416{
     417#ifdef VBOX_WITH_USB
    353418    if (!aFilter)
    354419        return E_INVALIDARG;
     
    407472
    408473    return S_OK;
     474#else
     475    return E_NOTIMPL;
     476#endif
    409477}
    410478
     
    412480                                                IUSBDeviceFilter **aFilter)
    413481{
     482#ifdef VBOX_WITH_USB
    414483    if (!aFilter)
    415484        return E_POINTER;
     
    472541
    473542    return S_OK;
     543#else
     544    return E_NOTIMPL;
     545#endif
    474546}
    475547
     
    516588    mData->mEnabledEhci = controller.value <bool> ("enabledEhci");
    517589
     590#ifdef VBOX_WITH_USB
    518591    HRESULT rc = S_OK;
    519592
     
    549622        filterObj->mInList = true;
    550623    }
     624#endif /* VBOX_WITH_USB */
    551625
    552626    return S_OK;
     
    573647    /* first, delete the entry */
    574648    Key controller = aMachineNode.findKey ("USBController");
     649#ifdef VBOX_WITH_USB
    575650    if (!controller.isNull())
    576651        controller.zap();
    577652    /* then, recreate it */
    578653    controller = aMachineNode.createKey ("USBController");
     654#else
     655    /* don't zap it. */
     656    if (!controller.isNull())
     657        controller = aMachineNode.createKey ("USBController");
     658#endif
    579659
    580660    /* enabled */
     
    584664    controller.setValue <bool> ("enabledEhci", !!mData->mEnabledEhci);
    585665
     666#ifdef VBOX_WITH_USB
    586667    DeviceFilterList::const_iterator it = mDeviceFilters->begin();
    587668    while (it != mDeviceFilters->end())
     
    633714        ++ it;
    634715    }
     716#endif /* VBOX_WITH_USB */
    635717
    636718    return S_OK;
     
    645727    AutoReaderLock alock (this);
    646728
    647     if (mData.isBackedUp() || mDeviceFilters.isBackedUp())
     729    if (mData.isBackedUp()
     730#ifdef VBOX_WITH_USB
     731        || mDeviceFilters.isBackedUp()
     732#endif
     733        )
    648734        return true;
    649735
     736#ifdef VBOX_WITH_USB
    650737    /* see whether any of filters has changed its data */
    651738    for (DeviceFilterList::const_iterator
     
    657744            return true;
    658745    }
     746#endif /* VBOX_WITH_USB */
    659747
    660748    return false;
     
    672760        return true;
    673761
     762#ifdef VBOX_WITH_USB
    674763    if (!mDeviceFilters.isBackedUp())
    675764    {
     
    720809
    721810    Assert (devices.size() == 0 && backDevices.size() == 0);
     811#endif /* VBOX_WITH_USB */
    722812
    723813    return false;
     
    746836    }
    747837
     838#ifdef VBOX_WITH_USB
    748839    if (mDeviceFilters.isBackedUp())
    749840    {
     
    827918        ++ it;
    828919    }
     920#endif /* VBOX_WITH_USB */
    829921
    830922    return dataChanged;
     
    850942    }
    851943
     944#ifdef VBOX_WITH_USB
    852945    bool commitFilters = false;
    853946
     
    9221015        }
    9231016    }
     1017#endif /* VBOX_WITH_USB */
    9241018}
    9251019
     
    9431037    mData.assignCopy (aThat->mData);
    9441038
     1039#ifdef VBOX_WITH_USB
    9451040    /* create private copies of all filters */
    9461041    mDeviceFilters.backup();
     
    9551050        mDeviceFilters->push_back (filter);
    9561051    }
     1052#endif /* VBOX_WITH_USB */
    9571053
    9581054    if (mParent->isRegistered())
     
    9861082    return S_OK;
    9871083}
     1084
     1085#ifdef VBOX_WITH_USB
    9881086
    9891087/**
     
    12421340}
    12431341
     1342#endif /* VBOX_WITH_USB */
     1343
    12441344// private methods
    12451345/////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Main/USBDeviceFilterImpl.cpp

    r7852 r7964  
    1 /* $Id:$ */
     1/* $Id$ */
    22/** @file
    3  * Implementation of VirtualBox COM components:
    4  * USBDeviceFilter and HostUSBDeviceFilter
     3 * Implementation of VirtualBox COM components: USBDeviceFilter and HostUSBDeviceFilter
    54 */
    65
  • trunk/src/VBox/Main/USBProxyService.cpp

    r7852 r7964  
     1/* $Id$ */
    12/** @file
    23 * VirtualBox USB Proxy Service (base) class.
     
    1617
    1718#include "USBProxyService.h"
     19#include "HostUSBDeviceImpl.h"
    1820#include "Logging.h"
     21#include "HostImpl.h"
    1922
    2023#include <VBox/err.h>
    2124#include <iprt/asm.h>
    2225#include <iprt/semaphore.h>
     26#include <iprt/thread.h>
     27#include <iprt/mem.h>
     28#include <iprt/string.h>
    2329
    2430
     
    3036 */
    3137USBProxyService::USBProxyService (Host *aHost)
    32     : mHost (aHost), mThread (NIL_RTTHREAD), mTerminate (false), mDevices (), mLastError (VINF_SUCCESS)
     38    : mHost (aHost), mThread (NIL_RTTHREAD), mTerminate (false), mLastError (VINF_SUCCESS), mDevices ()
    3339{
    3440    LogFlowThisFunc (("aHost=%p\n", aHost));
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r7912 r7964  
     1/* $Id$ */
    12/** @file
    2  *
    3  * VirtualBox COM class implementation
     3 * Implmentation of IVirtualBox in VBoxSVC.
    44 */
    55
  • trunk/src/VBox/Main/include/HostImpl.h

    r6076 r7964  
    11/* $Id$ */
    2 
    32/** @file
    4  *
    5  * VirtualBox COM class implementation
     3 * Implemenation of IHost.
    64 */
    75
     
    2220
    2321#include "VirtualBoxBase.h"
    24 #include "HostUSBDeviceImpl.h"
    25 #include "USBDeviceFilterImpl.h"
     22#ifdef VBOX_WITH_USB
     23# include "HostUSBDeviceImpl.h"
     24# include "USBDeviceFilterImpl.h"
     25# include "USBProxyService.h"
     26#else
     27class USBProxyService;
     28#endif
    2629
    2730#ifdef RT_OS_WINDOWS
    28 #include "win32/svchlp.h"
     31# include "win32/svchlp.h"
    2932#endif
    3033
     
    9598    // public methods only for internal purposes
    9699
    97     HRESULT onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter,
    98                                      BOOL aActiveChanged = FALSE);
    99 
    100100    HRESULT loadSettings (const settings::Key &aGlobal);
    101101    HRESULT saveSettings (settings::Key &aGlobal);
    102102
     103#ifdef VBOX_WITH_USB
     104    HRESULT onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter,
     105                                     BOOL aActiveChanged = FALSE);
    103106    HRESULT captureUSBDevice (SessionMachine *aMachine, INPTR GUIDPARAM aId);
    104107    HRESULT detachUSBDevice (SessionMachine *aMachine, INPTR GUIDPARAM aId, BOOL aDone);
     
    110113    void onUSBDeviceStateChanged (HostUSBDevice *aDevice);
    111114
     115    /* must be called from under this object's lock */
     116    USBProxyService *usbProxyService() { return mUSBProxyService; }
     117#else  /* !VBOX_WITH_USB */
     118    USBProxyService *usbProxyService() { return NULL; }
     119#endif /* !VBOX_WITH_USB */
     120
    112121    HRESULT checkUSBProxyService();
    113    
    114     /* must be called from under this object's lock */
    115     USBProxyService *usbProxyService() { return mUSBProxyService; }
    116122
    117123#ifdef RT_OS_WINDOWS
     
    134140#endif
    135141
     142#ifdef VBOX_WITH_USB
    136143    /** specialization for IHostUSBDeviceFilter */
    137144    ComObjPtr <HostUSBDeviceFilter> getDependentChild (IHostUSBDeviceFilter *aFilter)
     
    148155    bool applyMachineUSBFilters (SessionMachine *aMachine,
    149156                                 ComObjPtr <HostUSBDevice> &aDevice);
     157#endif /* VBOX_WITH_USB */
    150158
    151159#ifdef RT_OS_WINDOWS
     
    163171    ComObjPtr <VirtualBox, ComWeakRef> mParent;
    164172
     173#ifdef VBOX_WITH_USB
    165174    typedef std::list <ComObjPtr <HostUSBDevice> > USBDeviceList;
    166175    USBDeviceList mUSBDevices;
     
    171180    /** Pointer to the USBProxyService object. */
    172181    USBProxyService *mUSBProxyService;
     182#endif /* VBOX_WITH_USB */
    173183};
    174184
  • trunk/src/VBox/Main/include/USBControllerImpl.h

    r6851 r7964  
    2222
    2323#include "VirtualBoxBase.h"
    24 #include "USBDeviceFilterImpl.h"
     24#ifdef VBOX_WITH_USB
     25# include "USBDeviceFilterImpl.h"
     26#endif
    2527
    2628#include <list>
     
    113115    HRESULT onMachineRegistered (BOOL aRegistered);
    114116
     117#ifdef VBOX_WITH_USB
    115118    HRESULT onDeviceFilterChange (USBDeviceFilter *aFilter,
    116119                                  BOOL aActiveChanged = FALSE);
     
    120123
    121124    HRESULT notifyProxy (bool aInsertFilters);
     125#endif /* VBOX_WITH_USB */
    122126
    123127    // public methods for internal purposes only
     
    134138private:
    135139
     140#ifdef VBOX_WITH_USB
    136141    /** specialization for IUSBDeviceFilter */
    137142    ComObjPtr <USBDeviceFilter> getDependentChild (IUSBDeviceFilter *aFilter)
     
    142147                     : NULL;
    143148    }
     149#endif /* VBOX_WITH_USB */
    144150
    145151    void printList();
     
    152158    Backupable <Data> mData;
    153159
     160#ifdef VBOX_WITH_USB
    154161    // the following fields need special backup/rollback/commit handling,
    155162    // so they cannot be a part of Data
     
    157164    typedef std::list <ComObjPtr <USBDeviceFilter> > DeviceFilterList;
    158165    Backupable <DeviceFilterList> mDeviceFilters;
     166#endif /* VBOX_WITH_USB */
    159167};
    160168
  • trunk/src/VBox/Main/include/USBDeviceFilterImpl.h

    r7852 r7964  
     1/* $Id$ */
    12/** @file
    2  *
    3  * Declaration of VirtualBox COM components:
    4  * USBDeviceFilter and HostUSBDeviceFilter
     3 * Declaration of USBDeviceFilter and HostUSBDeviceFilter.
    54 */
    65
  • trunk/src/VBox/Main/include/USBProxyService.h

    r7852 r7964  
    2020#define ____H_USBPROXYSERVICE
    2121
    22 #include "HostImpl.h"
     22#include <VBox/usb.h>
     23#include <VBox/usbfilter.h>
    2324#include "HostUSBDeviceImpl.h"
     25class Host;
    2426
    2527/**
     
    235237    /** Flag which stop() sets to cause serviceThread to return. */
    236238    bool volatile mTerminate;
     239    /** VBox status code of the last failure.
     240     * (Only used by start(), stop() and the child constructors.) */
     241    int mLastError;
    237242    /** List of smart HostUSBDevice pointers. */
    238243    typedef std::list <ComObjPtr <HostUSBDevice> > HostUSBDeviceList;
    239244    /** List of the known USB devices. */
    240245    HostUSBDeviceList mDevices;
    241     /** VBox status code of the last failure.
    242      * (Only used by start(), stop() and the child constructors.) */
    243     int mLastError;
    244 };
    245 
    246 
    247 #ifdef VBOX_WITH_USB
     246};
     247
    248248
    249249# ifdef RT_OS_DARWIN
     
    438438# endif /* RT_OS_WINDOWS */
    439439
    440 #endif /* VBOX_WITH_USB */
    441 
    442440
    443441#endif /* !____H_USBPROXYSERVICE */
  • trunk/src/VBox/Main/linux/server.cpp

    r7442 r7964  
     1/* $Id$ */
    12/** @file
    2  *
    3  * XPCOM server process start point
     3 * XPCOM server process (VBoxSVC) start point.
    44 */
    55
     
    9090#include <HostDVDDriveImpl.h>
    9191#include <HostFloppyDriveImpl.h>
    92 #include <HostUSBDeviceImpl.h>
    9392#include <GuestOSTypeImpl.h>
    9493#include <NetworkAdapterImpl.h>
     
    9695#include <ParallelPortImpl.h>
    9796#include <USBControllerImpl.h>
    98 #include <USBDeviceImpl.h>
     97#ifdef VBOX_WITH_USB
     98# include <HostUSBDeviceImpl.h>
     99# include <USBDeviceImpl.h>
     100#endif
    99101#include <SATAControllerImpl.h>
    100102#include <AudioAdapterImpl.h>
     
    163165NS_DECL_CLASSINFO(SATAController)
    164166NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SATAController, ISATAController)
     167#ifdef VBOX_WITH_USB
    165168NS_DECL_CLASSINFO(USBDeviceFilter)
    166169NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilter, IUSBDeviceFilter)
     
    169172NS_DECL_CLASSINFO(HostUSBDeviceFilter)
    170173NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDeviceFilter, IUSBDeviceFilter, IHostUSBDeviceFilter)
     174#endif
    171175NS_DECL_CLASSINFO(AudioAdapter)
    172176NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AudioAdapter, IAudioAdapter)
     
    181185COM_IMPL_READONLY_ENUM_AND_COLLECTION(HardDiskAttachment)
    182186COM_IMPL_READONLY_ENUM_AND_COLLECTION(GuestOSType)
    183 COM_IMPL_READONLY_ENUM_AND_COLLECTION(USBDeviceFilter)
    184187COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive)
    185188COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive)
    186 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDevice)
    187 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDeviceFilter)
    188189COM_IMPL_READONLY_ENUM_AND_COLLECTION(HardDisk)
    189190COM_IMPL_READONLY_ENUM_AND_COLLECTION(DVDImage)
    190191COM_IMPL_READONLY_ENUM_AND_COLLECTION(FloppyImage)
    191192COM_IMPL_READONLY_ENUM_AND_COLLECTION(SharedFolder)
     193#ifdef VBOX_WITH_USB
     194COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDevice)
     195COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDeviceFilter)
     196COM_IMPL_READONLY_ENUM_AND_COLLECTION(USBDeviceFilter)
     197#endif
    192198
    193199COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(Progress, IProgress)
     200#ifdef VBOX_WITH_USB
    194201COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(IfaceUSBDevice, IUSBDevice)
     202#endif
    195203
    196204////////////////////////////////////////////////////////////////////////////////
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