Changeset 7964 in vbox
- Timestamp:
- Apr 14, 2008 5:56:52 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostImpl.cpp
r7944 r7964 1 /* $Id$ */ 1 2 /** @file 2 * VirtualBox COM class implementation 3 * VirtualBox COM class implementation: Host 3 4 */ 4 5 … … 73 74 #include "HostDVDDriveImpl.h" 74 75 #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 78 81 #include "VirtualBoxImpl.h" 79 82 #include "MachineImpl.h" … … 81 84 82 85 #ifdef RT_OS_DARWIN 83 # include "darwin/iokit.h"86 # include "darwin/iokit.h" 84 87 #endif 85 88 86 89 #ifdef RT_OS_WINDOWS 87 # include "HostNetworkInterfaceImpl.h"90 # include "HostNetworkInterfaceImpl.h" 88 91 #endif 89 92 … … 145 148 #elif defined (RT_OS_WINDOWS) && defined (VBOX_WITH_USB) 146 149 mUSBProxyService = new USBProxyServiceWin32 (this); 147 #el se150 #elif defined (VBOX_WITH_USB) 148 151 mUSBProxyService = new USBProxyService (this); 149 152 #endif … … 166 169 AssertReturn (isReady(), (void) 0); 167 170 171 #ifdef VBOX_WITH_USB 168 172 /* wait for USB proxy service to terminate before we uninit all USB 169 173 * devices */ 170 174 LogFlowThisFunc (("Stopping USB proxy service...\n")); 171 175 delete mUSBProxyService; 176 mUSBProxyService = NULL; 172 177 LogFlowThisFunc (("Done stopping USB proxy service.\n")); 173 mUSBProxyService = NULL; 178 #endif 174 179 175 180 /* uninit all USB device filters still referenced by clients */ 176 181 uninitDependentChildren(); 177 182 183 #ifdef VBOX_WITH_USB 178 184 mUSBDeviceFilters.clear(); 179 185 mUSBDevices.clear(); 186 #endif 180 187 181 188 setReady (FALSE); … … 1071 1078 //////////////////////////////////////////////////////////////////////////////// 1072 1079 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 proxy1087 if (aFilter->data().mActive)1088 {1089 ComAssertRet (aFilter->id() == NULL, E_FAIL);1090 aFilter->id() = mUSBProxyService->insertFilter (&aFilter->data().mUSBFilter);1091 }1092 else1093 {1094 ComAssertRet (aFilter->id() != NULL, E_FAIL);1095 mUSBProxyService->removeFilter (aFilter->id());1096 aFilter->id() = NULL;1097 }1098 }1099 else1100 {1101 if (aFilter->data().mActive)1102 {1103 // update the filter in the proxy1104 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 change1111 alock.unlock();1112 return mParent->saveSettings();1113 }1114 1115 return S_OK;1116 }1117 1118 1080 HRESULT Host::loadSettings (const settings::Key &aGlobal) 1119 1081 { … … 1127 1089 HRESULT rc = S_OK; 1128 1090 1091 #ifdef VBOX_WITH_USB 1129 1092 Key::List filters = aGlobal.key ("USBDeviceFilters").keys ("DeviceFilter"); 1130 1093 for (Key::List::const_iterator it = filters.begin(); … … 1172 1135 } 1173 1136 } 1137 #endif /* VBOX_WITH_USB */ 1174 1138 1175 1139 return rc; … … 1185 1149 ComAssertRet (!aGlobal.isNull(), E_FAIL); 1186 1150 1151 #ifdef VBOX_WITH_USB 1187 1152 /* first, delete the entry */ 1188 1153 Key filters = aGlobal.findKey ("USBDeviceFilters"); … … 1245 1210 ++ it; 1246 1211 } 1212 #endif /* VBOX_WITH_USB */ 1247 1213 1248 1214 return S_OK; 1249 1215 } 1216 1217 #ifdef VBOX_WITH_USB 1218 1219 /** 1220 * Called by setter methods of all USB device filters. 1221 */ 1222 HRESULT 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 1250 1264 1251 1265 /** … … 1502 1516 return S_OK; 1503 1517 } 1518 1519 #endif /* VBOX_HOST_USB */ 1504 1520 1505 1521 // private methods … … 1985 2001 #endif // RT_OS_LINUX || RT_OS_SOLARIS 1986 2002 2003 #ifdef VBOX_WITH_USB 2004 1987 2005 /** 1988 2006 * Applies all (golbal and VM) filters to the given USB device. The device … … 2260 2278 } 2261 2279 } 2280 #endif /* VBOX_WITH_USB */ 2262 2281 2263 2282 /** -
trunk/src/VBox/Main/MachineImpl.cpp
r7611 r7964 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VirtualBox COM class implementation 3 * Implementation of IMachine in VBoxSVC. 4 4 */ 5 5 … … 42 42 #include "SATAControllerImpl.h" 43 43 44 #include "USBProxyService.h" 44 #ifdef VBOX_WITH_USB 45 # include "USBProxyService.h" 46 #endif 45 47 46 48 #include "VirtualBoxXMLUtil.h" … … 7528 7530 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 7529 7531 7532 #ifdef VBOX_WITH_USB 7530 7533 *aMatched = mUSBController->hasMatchingFilter (aUSBDevice, aMaskedIfs); 7534 #else 7535 *aMatched = FALSE; 7536 #endif 7531 7537 7532 7538 return S_OK; … … 7543 7549 AssertComRCReturnRC (autoCaller.rc()); 7544 7550 7551 #ifdef VBOX_WITH_USB 7545 7552 /* if cautureUSBDevice() fails, it must have set extended error info */ 7546 7553 return mParent->host()->captureUSBDevice (this, aId); 7554 #else 7555 return E_FAIL; 7556 #endif 7547 7557 } 7548 7558 … … 7557 7567 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 7558 7568 7569 #ifdef VBOX_WITH_USB 7559 7570 return mParent->host()->detachUSBDevice (this, aId, aDone); 7571 #else 7572 return E_FAIL; 7573 #endif 7560 7574 } 7561 7575 … … 7575 7589 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 7576 7590 7591 #ifdef VBOX_WITH_USB 7577 7592 HRESULT rc = mUSBController->notifyProxy (true /* aInsertFilters */); 7578 7593 AssertComRC (rc); … … 7580 7595 7581 7596 return mParent->host()->autoCaptureUSBDevices (this); 7597 #else 7598 return S_OK; 7599 #endif 7582 7600 } 7583 7601 … … 7599 7617 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 7600 7618 7619 #ifdef VBOX_WITH_USB 7601 7620 HRESULT rc = mUSBController->notifyProxy (false /* aInsertFilters */); 7602 7621 AssertComRC (rc); … … 7604 7623 7605 7624 return mParent->host()->detachAllUSBDevices (this, aDone); 7625 #else 7626 return S_OK; 7627 #endif 7606 7628 } 7607 7629 … … 8534 8556 AutoReaderLock alock (this); 8535 8557 8558 #ifdef VBOX_WITH_USB 8536 8559 return mUSBController->hasMatchingFilter (aDevice, aMaskedIfs); 8560 #else 8561 return false; 8562 #endif 8537 8563 } 8538 8564 -
trunk/src/VBox/Main/Makefile.kmk
r7852 r7964 178 178 Logging.cpp \ 179 179 Matching.cpp \ 180 USBDeviceFilterImpl.cpp \181 USBProxyService.cpp \182 180 VirtualBoxBase.cpp \ 183 181 VirtualBoxErrorInfoImpl.cpp \ … … 196 194 HostDVDDriveImpl.cpp \ 197 195 HostFloppyDriveImpl.cpp \ 198 HostUSBDeviceImpl.cpp \199 196 GuestOSTypeImpl.cpp \ 200 197 NetworkAdapterImpl.cpp \ … … 233 230 234 231 ifdef VBOX_WITH_USB 232 VBoxSVC_SOURCES += \ 233 USBDeviceFilterImpl.cpp \ 234 USBProxyService.cpp \ 235 HostUSBDeviceImpl.cpp 235 236 VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp 236 237 VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp -
trunk/src/VBox/Main/USBControllerImpl.cpp
r7852 r7964 1 /* $Id$ */ 1 2 /** @file 2 *3 3 * Implementation of IUSBController. 4 4 */ … … 22 22 #include "VirtualBoxImpl.h" 23 23 #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 26 29 #include "Logging.h" 27 30 28 #include "USBProxyService.h"29 31 30 32 #include <iprt/string.h> … … 75 77 76 78 mData.allocate(); 79 #ifdef VBOX_WITH_USB 77 80 mDeviceFilters.allocate(); 81 #endif 78 82 79 83 /* Confirm a successful initialization */ … … 112 116 mData.share (aPeer->mData); 113 117 118 #ifdef VBOX_WITH_USB 114 119 /* create copies of all filters */ 115 120 mDeviceFilters.allocate(); … … 123 128 ++ it; 124 129 } 130 #endif /* VBOX_WITH_USB */ 125 131 126 132 /* Confirm a successful initialization */ … … 152 158 mData.attachCopy (aPeer->mData); 153 159 160 #ifdef VBOX_WITH_USB 154 161 /* create private copies of all filters */ 155 162 mDeviceFilters.allocate(); … … 163 170 ++ it; 164 171 } 172 #endif /* VBOX_WITH_USB */ 165 173 166 174 /* Confirm a successful initialization */ … … 187 195 uninitDependentChildren(); 188 196 197 #ifdef VBOX_WITH_USB 189 198 mDeviceFilters.free(); 199 #endif 190 200 mData.free(); 191 201 … … 293 303 /* not accessing data -- no need to lock */ 294 304 295 /** Note:This is no longer correct */305 /** @todo This is no longer correct */ 296 306 *aUSBStandard = 0x0101; 297 307 298 308 return S_OK; 299 309 } 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 */ 316 class ATL_NO_VTABLE USBDeviceFilter : public VirtualBoxBaseNEXT, public IUSBDeviceFilter 317 { 318 public: 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 }; 354 COM_DECL_READONLY_ENUM_AND_COLLECTION (USBDeviceFilter); 355 COM_IMPL_READONLY_ENUM_AND_COLLECTION (USBDeviceFilter); 356 #endif /* !VBOX_WITH_USB */ 357 300 358 301 359 STDMETHODIMP USBController::COMGETTER(DeviceFilters) (IUSBDeviceFilterCollection **aDevicesFilters) … … 311 369 ComObjPtr <USBDeviceFilterCollection> collection; 312 370 collection.createObject(); 371 #ifdef VBOX_WITH_USB 313 372 collection->init (*mDeviceFilters.data()); 373 #endif 314 374 collection.queryInterfaceTo (aDevicesFilters); 315 375 … … 323 383 IUSBDeviceFilter **aFilter) 324 384 { 385 #ifdef VBOX_WITH_USB 325 386 if (!aFilter) 326 387 return E_POINTER; … … 346 407 347 408 return S_OK; 409 #else 410 return E_NOTIMPL; 411 #endif 348 412 } 349 413 … … 351 415 IUSBDeviceFilter *aFilter) 352 416 { 417 #ifdef VBOX_WITH_USB 353 418 if (!aFilter) 354 419 return E_INVALIDARG; … … 407 472 408 473 return S_OK; 474 #else 475 return E_NOTIMPL; 476 #endif 409 477 } 410 478 … … 412 480 IUSBDeviceFilter **aFilter) 413 481 { 482 #ifdef VBOX_WITH_USB 414 483 if (!aFilter) 415 484 return E_POINTER; … … 472 541 473 542 return S_OK; 543 #else 544 return E_NOTIMPL; 545 #endif 474 546 } 475 547 … … 516 588 mData->mEnabledEhci = controller.value <bool> ("enabledEhci"); 517 589 590 #ifdef VBOX_WITH_USB 518 591 HRESULT rc = S_OK; 519 592 … … 549 622 filterObj->mInList = true; 550 623 } 624 #endif /* VBOX_WITH_USB */ 551 625 552 626 return S_OK; … … 573 647 /* first, delete the entry */ 574 648 Key controller = aMachineNode.findKey ("USBController"); 649 #ifdef VBOX_WITH_USB 575 650 if (!controller.isNull()) 576 651 controller.zap(); 577 652 /* then, recreate it */ 578 653 controller = aMachineNode.createKey ("USBController"); 654 #else 655 /* don't zap it. */ 656 if (!controller.isNull()) 657 controller = aMachineNode.createKey ("USBController"); 658 #endif 579 659 580 660 /* enabled */ … … 584 664 controller.setValue <bool> ("enabledEhci", !!mData->mEnabledEhci); 585 665 666 #ifdef VBOX_WITH_USB 586 667 DeviceFilterList::const_iterator it = mDeviceFilters->begin(); 587 668 while (it != mDeviceFilters->end()) … … 633 714 ++ it; 634 715 } 716 #endif /* VBOX_WITH_USB */ 635 717 636 718 return S_OK; … … 645 727 AutoReaderLock alock (this); 646 728 647 if (mData.isBackedUp() || mDeviceFilters.isBackedUp()) 729 if (mData.isBackedUp() 730 #ifdef VBOX_WITH_USB 731 || mDeviceFilters.isBackedUp() 732 #endif 733 ) 648 734 return true; 649 735 736 #ifdef VBOX_WITH_USB 650 737 /* see whether any of filters has changed its data */ 651 738 for (DeviceFilterList::const_iterator … … 657 744 return true; 658 745 } 746 #endif /* VBOX_WITH_USB */ 659 747 660 748 return false; … … 672 760 return true; 673 761 762 #ifdef VBOX_WITH_USB 674 763 if (!mDeviceFilters.isBackedUp()) 675 764 { … … 720 809 721 810 Assert (devices.size() == 0 && backDevices.size() == 0); 811 #endif /* VBOX_WITH_USB */ 722 812 723 813 return false; … … 746 836 } 747 837 838 #ifdef VBOX_WITH_USB 748 839 if (mDeviceFilters.isBackedUp()) 749 840 { … … 827 918 ++ it; 828 919 } 920 #endif /* VBOX_WITH_USB */ 829 921 830 922 return dataChanged; … … 850 942 } 851 943 944 #ifdef VBOX_WITH_USB 852 945 bool commitFilters = false; 853 946 … … 922 1015 } 923 1016 } 1017 #endif /* VBOX_WITH_USB */ 924 1018 } 925 1019 … … 943 1037 mData.assignCopy (aThat->mData); 944 1038 1039 #ifdef VBOX_WITH_USB 945 1040 /* create private copies of all filters */ 946 1041 mDeviceFilters.backup(); … … 955 1050 mDeviceFilters->push_back (filter); 956 1051 } 1052 #endif /* VBOX_WITH_USB */ 957 1053 958 1054 if (mParent->isRegistered()) … … 986 1082 return S_OK; 987 1083 } 1084 1085 #ifdef VBOX_WITH_USB 988 1086 989 1087 /** … … 1242 1340 } 1243 1341 1342 #endif /* VBOX_WITH_USB */ 1343 1244 1344 // private methods 1245 1345 ///////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/USBDeviceFilterImpl.cpp
r7852 r7964 1 /* $Id :$ */1 /* $Id$ */ 2 2 /** @file 3 * Implementation of VirtualBox COM components: 4 * USBDeviceFilter and HostUSBDeviceFilter 3 * Implementation of VirtualBox COM components: USBDeviceFilter and HostUSBDeviceFilter 5 4 */ 6 5 -
trunk/src/VBox/Main/USBProxyService.cpp
r7852 r7964 1 /* $Id$ */ 1 2 /** @file 2 3 * VirtualBox USB Proxy Service (base) class. … … 16 17 17 18 #include "USBProxyService.h" 19 #include "HostUSBDeviceImpl.h" 18 20 #include "Logging.h" 21 #include "HostImpl.h" 19 22 20 23 #include <VBox/err.h> 21 24 #include <iprt/asm.h> 22 25 #include <iprt/semaphore.h> 26 #include <iprt/thread.h> 27 #include <iprt/mem.h> 28 #include <iprt/string.h> 23 29 24 30 … … 30 36 */ 31 37 USBProxyService::USBProxyService (Host *aHost) 32 : mHost (aHost), mThread (NIL_RTTHREAD), mTerminate (false), m Devices (), mLastError (VINF_SUCCESS)38 : mHost (aHost), mThread (NIL_RTTHREAD), mTerminate (false), mLastError (VINF_SUCCESS), mDevices () 33 39 { 34 40 LogFlowThisFunc (("aHost=%p\n", aHost)); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r7912 r7964 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VirtualBox COM class implementation 3 * Implmentation of IVirtualBox in VBoxSVC. 4 4 */ 5 5 -
trunk/src/VBox/Main/include/HostImpl.h
r6076 r7964 1 1 /* $Id$ */ 2 3 2 /** @file 4 * 5 * VirtualBox COM class implementation 3 * Implemenation of IHost. 6 4 */ 7 5 … … 22 20 23 21 #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 27 class USBProxyService; 28 #endif 26 29 27 30 #ifdef RT_OS_WINDOWS 28 # include "win32/svchlp.h"31 # include "win32/svchlp.h" 29 32 #endif 30 33 … … 95 98 // public methods only for internal purposes 96 99 97 HRESULT onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter,98 BOOL aActiveChanged = FALSE);99 100 100 HRESULT loadSettings (const settings::Key &aGlobal); 101 101 HRESULT saveSettings (settings::Key &aGlobal); 102 102 103 #ifdef VBOX_WITH_USB 104 HRESULT onUSBDeviceFilterChange (HostUSBDeviceFilter *aFilter, 105 BOOL aActiveChanged = FALSE); 103 106 HRESULT captureUSBDevice (SessionMachine *aMachine, INPTR GUIDPARAM aId); 104 107 HRESULT detachUSBDevice (SessionMachine *aMachine, INPTR GUIDPARAM aId, BOOL aDone); … … 110 113 void onUSBDeviceStateChanged (HostUSBDevice *aDevice); 111 114 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 112 121 HRESULT checkUSBProxyService(); 113 114 /* must be called from under this object's lock */115 USBProxyService *usbProxyService() { return mUSBProxyService; }116 122 117 123 #ifdef RT_OS_WINDOWS … … 134 140 #endif 135 141 142 #ifdef VBOX_WITH_USB 136 143 /** specialization for IHostUSBDeviceFilter */ 137 144 ComObjPtr <HostUSBDeviceFilter> getDependentChild (IHostUSBDeviceFilter *aFilter) … … 148 155 bool applyMachineUSBFilters (SessionMachine *aMachine, 149 156 ComObjPtr <HostUSBDevice> &aDevice); 157 #endif /* VBOX_WITH_USB */ 150 158 151 159 #ifdef RT_OS_WINDOWS … … 163 171 ComObjPtr <VirtualBox, ComWeakRef> mParent; 164 172 173 #ifdef VBOX_WITH_USB 165 174 typedef std::list <ComObjPtr <HostUSBDevice> > USBDeviceList; 166 175 USBDeviceList mUSBDevices; … … 171 180 /** Pointer to the USBProxyService object. */ 172 181 USBProxyService *mUSBProxyService; 182 #endif /* VBOX_WITH_USB */ 173 183 }; 174 184 -
trunk/src/VBox/Main/include/USBControllerImpl.h
r6851 r7964 22 22 23 23 #include "VirtualBoxBase.h" 24 #include "USBDeviceFilterImpl.h" 24 #ifdef VBOX_WITH_USB 25 # include "USBDeviceFilterImpl.h" 26 #endif 25 27 26 28 #include <list> … … 113 115 HRESULT onMachineRegistered (BOOL aRegistered); 114 116 117 #ifdef VBOX_WITH_USB 115 118 HRESULT onDeviceFilterChange (USBDeviceFilter *aFilter, 116 119 BOOL aActiveChanged = FALSE); … … 120 123 121 124 HRESULT notifyProxy (bool aInsertFilters); 125 #endif /* VBOX_WITH_USB */ 122 126 123 127 // public methods for internal purposes only … … 134 138 private: 135 139 140 #ifdef VBOX_WITH_USB 136 141 /** specialization for IUSBDeviceFilter */ 137 142 ComObjPtr <USBDeviceFilter> getDependentChild (IUSBDeviceFilter *aFilter) … … 142 147 : NULL; 143 148 } 149 #endif /* VBOX_WITH_USB */ 144 150 145 151 void printList(); … … 152 158 Backupable <Data> mData; 153 159 160 #ifdef VBOX_WITH_USB 154 161 // the following fields need special backup/rollback/commit handling, 155 162 // so they cannot be a part of Data … … 157 164 typedef std::list <ComObjPtr <USBDeviceFilter> > DeviceFilterList; 158 165 Backupable <DeviceFilterList> mDeviceFilters; 166 #endif /* VBOX_WITH_USB */ 159 167 }; 160 168 -
trunk/src/VBox/Main/include/USBDeviceFilterImpl.h
r7852 r7964 1 /* $Id$ */ 1 2 /** @file 2 * 3 * Declaration of VirtualBox COM components: 4 * USBDeviceFilter and HostUSBDeviceFilter 3 * Declaration of USBDeviceFilter and HostUSBDeviceFilter. 5 4 */ 6 5 -
trunk/src/VBox/Main/include/USBProxyService.h
r7852 r7964 20 20 #define ____H_USBPROXYSERVICE 21 21 22 #include "HostImpl.h" 22 #include <VBox/usb.h> 23 #include <VBox/usbfilter.h> 23 24 #include "HostUSBDeviceImpl.h" 25 class Host; 24 26 25 27 /** … … 235 237 /** Flag which stop() sets to cause serviceThread to return. */ 236 238 bool volatile mTerminate; 239 /** VBox status code of the last failure. 240 * (Only used by start(), stop() and the child constructors.) */ 241 int mLastError; 237 242 /** List of smart HostUSBDevice pointers. */ 238 243 typedef std::list <ComObjPtr <HostUSBDevice> > HostUSBDeviceList; 239 244 /** List of the known USB devices. */ 240 245 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 248 248 249 249 # ifdef RT_OS_DARWIN … … 438 438 # endif /* RT_OS_WINDOWS */ 439 439 440 #endif /* VBOX_WITH_USB */441 442 440 443 441 #endif /* !____H_USBPROXYSERVICE */ -
trunk/src/VBox/Main/linux/server.cpp
r7442 r7964 1 /* $Id$ */ 1 2 /** @file 2 * 3 * XPCOM server process start point 3 * XPCOM server process (VBoxSVC) start point. 4 4 */ 5 5 … … 90 90 #include <HostDVDDriveImpl.h> 91 91 #include <HostFloppyDriveImpl.h> 92 #include <HostUSBDeviceImpl.h>93 92 #include <GuestOSTypeImpl.h> 94 93 #include <NetworkAdapterImpl.h> … … 96 95 #include <ParallelPortImpl.h> 97 96 #include <USBControllerImpl.h> 98 #include <USBDeviceImpl.h> 97 #ifdef VBOX_WITH_USB 98 # include <HostUSBDeviceImpl.h> 99 # include <USBDeviceImpl.h> 100 #endif 99 101 #include <SATAControllerImpl.h> 100 102 #include <AudioAdapterImpl.h> … … 163 165 NS_DECL_CLASSINFO(SATAController) 164 166 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SATAController, ISATAController) 167 #ifdef VBOX_WITH_USB 165 168 NS_DECL_CLASSINFO(USBDeviceFilter) 166 169 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBDeviceFilter, IUSBDeviceFilter) … … 169 172 NS_DECL_CLASSINFO(HostUSBDeviceFilter) 170 173 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDeviceFilter, IUSBDeviceFilter, IHostUSBDeviceFilter) 174 #endif 171 175 NS_DECL_CLASSINFO(AudioAdapter) 172 176 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AudioAdapter, IAudioAdapter) … … 181 185 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HardDiskAttachment) 182 186 COM_IMPL_READONLY_ENUM_AND_COLLECTION(GuestOSType) 183 COM_IMPL_READONLY_ENUM_AND_COLLECTION(USBDeviceFilter)184 187 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive) 185 188 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive) 186 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDevice)187 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDeviceFilter)188 189 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HardDisk) 189 190 COM_IMPL_READONLY_ENUM_AND_COLLECTION(DVDImage) 190 191 COM_IMPL_READONLY_ENUM_AND_COLLECTION(FloppyImage) 191 192 COM_IMPL_READONLY_ENUM_AND_COLLECTION(SharedFolder) 193 #ifdef VBOX_WITH_USB 194 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDevice) 195 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostUSBDeviceFilter) 196 COM_IMPL_READONLY_ENUM_AND_COLLECTION(USBDeviceFilter) 197 #endif 192 198 193 199 COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(Progress, IProgress) 200 #ifdef VBOX_WITH_USB 194 201 COM_IMPL_READONLY_ENUM_AND_COLLECTION_AS(IfaceUSBDevice, IUSBDevice) 202 #endif 195 203 196 204 ////////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.