Changeset 24989 in vbox for trunk/src/VBox/Main/USBControllerImpl.cpp
- Timestamp:
- Nov 26, 2009 11:31:46 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/USBControllerImpl.cpp
r23271 r24989 459 459 460 460 /* notify the proxy (only when it makes sense) */ 461 if (filter-> data().mActive && Global::IsOnline(adep.machineState()))462 { 463 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();461 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 462 { 463 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 464 464 ComAssertRet (service, E_FAIL); 465 465 466 ComAssertRet (filter->id() == NULL, E_FAIL);467 filter-> id() = service->insertFilter (&filter->data().mUSBFilter);466 ComAssertRet(filter->getId() == NULL, E_FAIL); 467 filter->getId() = service->insertFilter (&filter->getData().mUSBFilter); 468 468 } 469 469 … … 525 525 526 526 /* notify the proxy (only when it makes sense) */ 527 if (filter-> data().mActive && Global::IsOnline(adep.machineState()))528 { 529 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();527 if (filter->getData().mActive && Global::IsOnline(adep.machineState())) 528 { 529 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 530 530 ComAssertRet (service, E_FAIL); 531 531 532 ComAssertRet (filter->id() != NULL, E_FAIL);533 service->removeFilter (filter->id());534 filter-> id() = NULL;532 ComAssertRet(filter->getId() != NULL, E_FAIL); 533 service->removeFilter(filter->getId()); 534 filter->getId() = NULL; 535 535 } 536 536 … … 623 623 { 624 624 AutoWriteLock filterLock (*it); 625 const USBDeviceFilter::Data &filterData = (*it)-> data();625 const USBDeviceFilter::Data &filterData = (*it)->getData(); 626 626 627 627 Bstr str; … … 728 728 while (thatIt != backDevices.end()) 729 729 { 730 if ((*it)-> data() == (*thatIt)->data())730 if ((*it)->getData() == (*thatIt)->getData()) 731 731 { 732 732 backDevices.erase (thatIt); … … 775 775 if (mDeviceFilters.isBackedUp()) 776 776 { 777 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();777 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 778 778 ComAssertRet (service, false); 779 779 … … 787 787 { 788 788 /* notify the proxy (only when it makes sense) */ 789 if ((*it)-> data().mActive &&789 if ((*it)->getData().mActive && 790 790 Global::IsOnline (adep.machineState())) 791 791 { 792 792 USBDeviceFilter *filter = *it; 793 ComAssertRet (filter->id() != NULL, false);794 service->removeFilter (filter->id());795 filter-> id() = NULL;793 ComAssertRet(filter->getId() != NULL, false); 794 service->removeFilter(filter->getId()); 795 filter->getId() = NULL; 796 796 } 797 797 … … 812 812 { 813 813 /* notify the proxy (only when necessary) */ 814 if ((*it)-> data().mActive)814 if ((*it)->getData().mActive) 815 815 { 816 816 USBDeviceFilter *flt = *it; /* resolve ambiguity */ 817 ComAssertRet (flt->id() == NULL, false);818 flt-> id() = service->insertFilter (&flt->data().mUSBFilter);817 ComAssertRet(flt->getId() == NULL, false); 818 flt->getId() = service->insertFilter(&flt->getData().mUSBFilter); 819 819 } 820 820 } … … 1029 1029 if (aFilter->mInList && mParent->isRegistered()) 1030 1030 { 1031 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();1031 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 1032 1032 ComAssertRet (service, E_FAIL); 1033 1033 … … 1035 1035 { 1036 1036 /* insert/remove the filter from the proxy */ 1037 if (aFilter-> data().mActive)1037 if (aFilter->getData().mActive) 1038 1038 { 1039 ComAssertRet (aFilter->id() == NULL, E_FAIL);1040 aFilter-> id() = service->insertFilter (&aFilter->data().mUSBFilter);1039 ComAssertRet(aFilter->getId() == NULL, E_FAIL); 1040 aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); 1041 1041 } 1042 1042 else 1043 1043 { 1044 ComAssertRet (aFilter->id() != NULL, E_FAIL);1045 service->removeFilter (aFilter->id());1046 aFilter-> id() = NULL;1044 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1045 service->removeFilter(aFilter->getId()); 1046 aFilter->getId() = NULL; 1047 1047 } 1048 1048 } 1049 1049 else 1050 1050 { 1051 if (aFilter-> data().mActive)1051 if (aFilter->getData().mActive) 1052 1052 { 1053 1053 /* update the filter in the proxy */ 1054 ComAssertRet (aFilter->id() != NULL, E_FAIL);1055 service->removeFilter (aFilter->id());1056 aFilter-> id() = service->insertFilter (&aFilter->data().mUSBFilter);1054 ComAssertRet(aFilter->getId() != NULL, E_FAIL); 1055 service->removeFilter(aFilter->getId()); 1056 aFilter->getId() = service->insertFilter(&aFilter->getData().mUSBFilter); 1057 1057 } 1058 1058 } … … 1087 1087 { 1088 1088 AutoWriteLock filterLock (*it); 1089 if (aDevice->isMatch ((*it)->data()))1089 if (aDevice->isMatch((*it)->getData())) 1090 1090 { 1091 *aMaskedIfs = (*it)-> data().mMaskedIfs;1091 *aMaskedIfs = (*it)->getData().mMaskedIfs; 1092 1092 return true; 1093 1093 } … … 1184 1184 { 1185 1185 AutoWriteLock filterLock (*it); 1186 const USBDeviceFilter::Data &aData = (*it)-> data();1186 const USBDeviceFilter::Data &aData = (*it)->getData(); 1187 1187 1188 1188 if (!aData.mActive) … … 1221 1221 AutoReadLock alock(this); 1222 1222 1223 USBProxyService *service = mParent-> virtualBox()->host()->usbProxyService();1223 USBProxyService *service = mParent->getVirtualBox()->host()->usbProxyService(); 1224 1224 AssertReturn(service, E_FAIL); 1225 1225 … … 1230 1230 1231 1231 /* notify the proxy (only if the filter is active) */ 1232 if (flt-> data().mActive)1232 if (flt->getData().mActive) 1233 1233 { 1234 1234 if (aInsertFilters) 1235 1235 { 1236 AssertReturn(flt-> id() == NULL, E_FAIL);1237 flt-> id() = service->insertFilter (&flt->data().mUSBFilter);1236 AssertReturn(flt->getId() == NULL, E_FAIL); 1237 flt->getId() = service->insertFilter(&flt->getData().mUSBFilter); 1238 1238 } 1239 1239 else … … 1242 1242 * when this method gets called (as a result of an early VM 1243 1243 * process crash for example. So, don't assert that ID != NULL. */ 1244 if (flt-> id() != NULL)1244 if (flt->getId() != NULL) 1245 1245 { 1246 service->removeFilter (flt->id());1247 flt-> id() = NULL;1246 service->removeFilter(flt->getId()); 1247 flt->getId() = NULL; 1248 1248 } 1249 1249 }
Note:
See TracChangeset
for help on using the changeset viewer.