VirtualBox

Changeset 3758 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 21, 2007 8:55:37 PM (18 years ago)
Author:
vboxsync
Message:

More USBFILTER changes.

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

Legend:

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

    r3756 r3758  
    939939    {
    940940        ComAssertRet (filter->id() == NULL, E_FAIL);
     941#ifndef VBOX_WITH_USBFILTER
    941942        filter->id() =
    942943            mUSBProxyService->insertFilter (ComPtr <IUSBDeviceFilter> (aFilter));
     944#else
     945        filter->id() = mUSBProxyService->insertFilter (&filter->data().mUSBFilter);
     946#endif
    943947    }
    944948
     
    10281032            {
    10291033                ComAssertRet (aFilter->id() == NULL, E_FAIL);
     1034#ifndef VBOX_WITH_USBFILTER
    10301035                aFilter->id() =
    10311036                    mUSBProxyService->insertFilter (ComPtr <IUSBDeviceFilter> (aFilter));
     1037#else
     1038                aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
     1039#endif
    10321040            }
    10331041            else
     
    10451053                ComAssertRet (aFilter->id() != NULL, E_FAIL);
    10461054                mUSBProxyService->removeFilter (aFilter->id());
     1055#ifndef VBOX_WITH_USBFILTER
    10471056                aFilter->id() =
    10481057                    mUSBProxyService->insertFilter (ComPtr <IUSBDeviceFilter> (aFilter));
     1058#else
     1059                aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);
     1060#endif
    10491061            }
    10501062        }
     
    11271139            {
    11281140                HostUSBDeviceFilter *flt = filterObj; // resolve ambiguity
     1141#ifndef VBOX_WITH_USBFILTER
    11291142                flt->id() =
    11301143                    mUSBProxyService->insertFilter (ComPtr <IUSBDeviceFilter> (flt));
     1144#else
     1145                flt->id() = mUSBProxyService->insertFilter (&filterObj->data().mUSBFilter);
     1146#endif
    11311147            }
    11321148        }
  • trunk/src/VBox/Main/Makefile.kmk

    r3756 r3758  
    222222#ifeq ($(filter-out darwin,$(BUILD_TARGET)),)
    223223#VBoxSVC_DEFS += VBOX_WITH_USBFILTER
    224 #VBoxSVC_LIBS += $(PATH_LIB)/USBFilter$(VBOX_SUFF_LIB)
     224#VBoxSVC_LIBS += $(PATH_LIB)/USBLib$(VBOX_SUFF_LIB)
    225225#endif
    226226
  • trunk/src/VBox/Main/USBControllerImpl.cpp

    r3756 r3758  
    368368
    369369        ComAssertRet (filter->id() == NULL, E_FAIL);
     370#ifndef VBOX_WITH_USBFILTER
    370371        filter->id() = service->insertFilter (ComPtr <IUSBDeviceFilter> (aFilter));
     372#else
     373        filter->id() = service->insertFilter (&filter->data().mUSBFilter);
     374#endif
    371375    }
    372376
     
    786790                        USBDeviceFilter *flt = *it; /* resolve ambiguity */
    787791                        ComAssertRet (flt->id() == NULL, false);
     792#ifndef VBOX_WITH_USBFILTER
    788793                        flt->id() = service->insertFilter
    789794                            (ComPtr <IUSBDeviceFilter> (flt));
     795#else
     796                        flt->id() = service->insertFilter (&flt->data().mUSBFilter);
     797#endif
    790798                    }
    791799                }
     
    10101018            {
    10111019                ComAssertRet (aFilter->id() == NULL, E_FAIL);
     1020#ifndef VBOX_WITH_USBFILTER
    10121021                aFilter->id() = service->insertFilter
    10131022                    (ComPtr <IUSBDeviceFilter> (aFilter));
     1023#else
     1024                aFilter->id() = service->insertFilter (&aFilter->data().mUSBFilter);
     1025#endif
    10141026            }
    10151027            else
     
    10271039                ComAssertRet (aFilter->id() != NULL, E_FAIL);
    10281040                service->removeFilter (aFilter->id());
     1041#ifndef VBOX_WITH_USBFILTER
    10291042                aFilter->id() = service->insertFilter
    10301043                    (ComPtr <IUSBDeviceFilter> (aFilter));
     1044#else
     1045                aFilter->id() = service->insertFilter (&aFilter->data().mUSBFilter);
     1046#endif
    10311047            }
    10321048        }
     
    12471263            {
    12481264                AssertReturn (flt->id() == NULL, E_FAIL);
     1265#ifndef VBOX_WITH_USBFILTER
    12491266                flt->id() = service->insertFilter
    12501267                    (ComPtr <IUSBDeviceFilter> (flt));
     1268#else
     1269                flt->id() = service->insertFilter (&flt->data().mUSBFilter);
     1270#endif
    12511271            }
    12521272            else
  • trunk/src/VBox/Main/USBProxyService.cpp

    r3664 r3758  
    539539 *  for those subclasses that don't reimplement this method.
    540540 */
     541#ifndef VBOX_WITH_USBFILTER
    541542void *USBProxyService::insertFilter (IUSBDeviceFilter * /* aFilter */)
     543#else
     544void *USBProxyService::insertFilter (PCUSBFILTER /* aFilter */)
     545#endif
    542546{
    543547    // return non-NULL to prevent failed assertions in Main
     
    546550
    547551
    548 void USBProxyService::removeFilter (void * /* aID */)
     552void USBProxyService::removeFilter (void * /* aId */)
    549553{
    550554}
  • trunk/src/VBox/Main/include/USBProxyService.h

    r3668 r3758  
    4242     * @return  ID of the inserted filter
    4343     */
     44#ifdef VBOX_WITH_USBFILTER
     45    virtual void *insertFilter (PCUSBFILTER aFilter);
     46#else
    4447    virtual void *insertFilter (IUSBDeviceFilter *aFilter);
     48#endif
    4549
    4650    /**
    4751     * A filter was removed.
    4852     *
    49      * @param   aID             ID of the filter to remove
    50      */
    51     virtual void removeFilter (void *aID);
     53     * @param   aId             ID of the filter to remove
     54     */
     55    virtual void removeFilter (void *aId);
    5256
    5357    /**
     
    260264    ~USBProxyServiceDarwin();
    261265
     266#ifdef VBOX_WITH_USBFILTER
     267    virtual void *insertFilter (PCUSBFILTER aFilter);
     268    virtual void removeFilter (void *aId);
     269#endif
     270
    262271    virtual int captureDevice (HostUSBDevice *aDevice);
    263272    virtual int holdDevice (HostUSBDevice *aDevice);
     
    284293    /** Whether we've got a fake async event and should return without entering the runloop. */
    285294    bool volatile mFakeAsync;
     295    /** Whether we've successfully initialized the USBLib and should call USBLibTerm in the destructor. */
     296    bool mUSBLibInitialized;
    286297};
    287298# endif /* RT_OS_DARWIN */
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