Changeset 60089 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Mar 18, 2016 10:51:02 AM (9 years ago)
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/HostImpl.h
r60068 r60089 145 145 HRESULT generateMACAddress(com::Utf8Str &aAddress); 146 146 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 147 152 // Internal Methods. 148 153 -
trunk/src/VBox/Main/include/USBProxyBackend.h
r60068 r60089 30 30 #include "VirtualBoxImpl.h" 31 31 #include "HostUSBDeviceImpl.h" 32 #include "USBProxyBackendWrap.h" 32 33 class USBProxyService; 33 34 … … 35 36 * Base class for the USB Proxy Backend. 36 37 */ 37 class USBProxyBackend 38 : public VirtualBoxTranslatable 39 { 40 public: 41 USBProxyBackend(USBProxyService *pUsbProxyService); 42 virtual int init(void); 43 virtual ~USBProxyBackend(); 44 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 } 38 class ATL_NO_VTABLE USBProxyBackend 39 : public USBProxyBackendWrap 40 { 41 public: 42 43 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackend) 44 45 HRESULT FinalConstruct(); 46 void FinalRelease(); 47 48 // public initializer/uninitializer for internal purposes only 49 virtual int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 50 virtual void uninit(); 55 51 56 52 bool isActive(void); 57 58 RWLockHandle *lockHandle() const;53 const com::Utf8Str &i_getId(); 54 uint32_t i_getRefCount(); 59 55 60 56 /** @name Interface for the USBController and the Host object. … … 96 92 virtual PUSBDEVICE getDevices(void); 97 93 bool updateDeviceStateFake(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, SessionMachine **aIgnoreMachine); 94 uint32_t incRef(); 95 uint32_t decRef(); 98 96 99 97 static HRESULT setError(HRESULT aResultCode, const char *aText, ...); … … 104 102 private: 105 103 104 // wrapped IUSBProxyBackend properties 105 HRESULT getName(com::Utf8Str &aName); 106 HRESULT getType(com::Utf8Str &aType); 107 106 108 static DECLCALLBACK(int) serviceThread(RTTHREAD Thread, void *pvUser); 107 109 108 110 protected: 109 111 /** Pointer to the owning USB Proxy Service object. */ 110 USBProxyService *m_pUsbProxyService;112 USBProxyService *m_pUsbProxyService; 111 113 /** Thread handle of the service thread. */ 112 RTTHREAD mThread;114 RTTHREAD mThread; 113 115 /** Flag which stop() sets to cause serviceThread to return. */ 114 bool volatile mTerminate; 116 bool volatile mTerminate; 117 /** Id of the instance. */ 118 const com::Utf8Str m_strId; 119 /** Reference counter which prevents the backend instance from being removed. */ 120 uint32_t m_cRefs; 115 121 }; 116 122 … … 130 136 { 131 137 public: 132 USBProxyBackendDarwin(USBProxyService *pUsbProxyService); 133 int init(void); 134 ~USBProxyBackendDarwin(); 138 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendDarwin) 139 140 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 141 void uninit(); 135 142 136 143 virtual void *insertFilter(PCUSBFILTER aFilter); … … 179 186 { 180 187 public: 181 USBProxyBackendLinux(USBProxyService *pUsbProxyService); 182 int init(void); 183 ~USBProxyBackendLinux(); 188 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendLinux) 189 190 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 191 void uninit(); 184 192 185 193 virtual int captureDevice(HostUSBDevice *aDevice); … … 230 238 { 231 239 public: 232 USBProxyBackendOs2 (USBProxyService *pUsbProxyService); 233 /// @todo virtual int init(void); 234 ~USBProxyBackendOs2(); 240 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackend) 235 241 236 242 virtual int captureDevice (HostUSBDevice *aDevice); … … 272 278 { 273 279 public: 274 USBProxyBackendSolaris(USBProxyService *pUsbProxyService); 275 int init(void); 276 ~USBProxyBackendSolaris(); 280 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendSolaris) 281 282 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 283 void uninit(); 277 284 278 285 virtual void *insertFilter (PCUSBFILTER aFilter); … … 305 312 { 306 313 public: 307 USBProxyBackendWindows(USBProxyService *pUsbProxyService); 308 int init(void); 309 ~USBProxyBackendWindows(); 314 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendWindows) 315 316 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 317 void uninit(); 310 318 311 319 virtual void *insertFilter (PCUSBFILTER aFilter); … … 334 342 { 335 343 public: 336 USBProxyBackendFreeBSD(USBProxyService *pUsbProxyService); 337 int init(void); 338 ~USBProxyBackendFreeBSD(); 344 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendFreeBSD) 345 346 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 347 void uninit(); 339 348 340 349 virtual int captureDevice(HostUSBDevice *aDevice); … … 369 378 /** Waiting for the complete reception of a UsbIpExportedDevice structure. */ 370 379 kUsbIpRecvState_ExportedDevice, 371 /** Waiting for a complete reception a UsbIpDeviceInterface strucutre to skip. */380 /** Waiting for a complete reception of a UsbIpDeviceInterface structure to skip. */ 372 381 kUsbIpRecvState_DeviceInterface, 373 382 /** 32bit hack. */ … … 385 394 { 386 395 public: 387 USBProxyBackendUsbIp(USBProxyService *pUsbProxyService); 388 int init(void); 389 ~USBProxyBackendUsbIp(); 396 DECLARE_EMPTY_CTOR_DTOR (USBProxyBackendUsbIp) 397 398 int init(USBProxyService *pUsbProxyService, const com::Utf8Str &strId, const com::Utf8Str &strAddress); 399 void uninit(); 390 400 391 401 virtual int captureDevice(HostUSBDevice *aDevice); -
trunk/src/VBox/Main/include/USBProxyService.h
r60068 r60089 51 51 } 52 52 53 void uninit(void); 54 53 55 bool isActive(void); 54 56 int getLastError(void); … … 65 67 * @{ */ 66 68 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); 67 72 /** @} */ 68 73 … … 78 83 79 84 void i_updateDeviceList(USBProxyBackend *pUsbProxyBackend, PUSBDEVICE pDevices); 80 void i_getUSBFilters(USBDeviceFilterList *pGlobalFilte s);85 void i_getUSBFilters(USBDeviceFilterList *pGlobalFilters); 81 86 82 87 protected: … … 84 89 85 90 static HRESULT setError(HRESULT aResultCode, const char *aText, ...); 91 92 USBProxyBackend *findUsbProxyBackendById(const com::Utf8Str &strId); 86 93 87 94 private: … … 94 101 HostUSBDeviceList mDevices; 95 102 /** List of USBProxyBackend pointers. */ 96 typedef std::list< USBProxyBackend *> USBProxyBackendList;103 typedef std::list<ComObjPtr<USBProxyBackend> > USBProxyBackendList; 97 104 /** List of active USB backends. */ 98 105 USBProxyBackendList mBackends;
Note:
See TracChangeset
for help on using the changeset viewer.