Changeset 5713 in vbox
- Timestamp:
- Nov 12, 2007 5:06:56 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 26069
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmusb.h
r5529 r5713 581 581 * @param pvBackend Pointer to the backend. 582 582 * @param iUsbVersion The preferred USB version. 583 */ 584 PDMR3DECL(int) PDMR3USBCreateProxyDevice(PVM pVM, PCRTUUID pUuid, bool fRemote, const char *pszAddress, void *pvBackend, uint32_t iUsbVersion); 583 * @param fMaskedIfs The interfaces to hide from the guest. 584 */ 585 PDMR3DECL(int) PDMR3USBCreateProxyDevice(PVM pVM, PCRTUUID pUuid, bool fRemote, const char *pszAddress, void *pvBackend, 586 uint32_t iUsbVersion, uint32_t fMaskedIfs); 585 587 586 588 /** -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r5615 r5713 189 189 Bstr mRemote; 190 190 Bstr mSerialNumber; 191 Nullable <ULONG> mMaskedInterfaces; 191 192 USBDeviceFilterAction_T mAction; 192 193 }; … … 556 557 " [-remote yes|no] (null, VM filters only)\n" 557 558 " [-serialnumber <string>] (null)\n" 559 " [-maskedinterfaces <XXXXXXXX>]\n" 558 560 "\n"); 559 561 } … … 573 575 " [-remote yes|no] (null, VM filters only)\n" 574 576 " [-serialnumber <string>|\"\"]\n" 577 " [-maskedinterfaces <XXXXXXXX>]\n" 575 578 "\n"); 576 579 } … … 1631 1634 RTPrintf("USBFilterRemote%d=\"%lS\"\n", index + 1, bstr.raw()); 1632 1635 else 1633 RTPrintf("Remote: %lS\n \n", bstr.raw());1636 RTPrintf("Remote: %lS\n", bstr.raw()); 1634 1637 CHECK_ERROR_RET (DevPtr, COMGETTER (SerialNumber) (bstr.asOutParam()), rc); 1635 1638 if (details == VMINFO_MACHINEREADABLE) 1636 1639 RTPrintf("USBFilterSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw()); 1637 1640 else 1638 RTPrintf("Serial Number: %lS\n\n", bstr.raw()); 1641 RTPrintf("Serial Number: %lS\n", bstr.raw()); 1642 if (details != VMINFO_MACHINEREADABLE) 1643 { 1644 ULONG fMaskedIfs; 1645 CHECK_ERROR_RET (DevPtr, COMGETTER (MaskedInterfaces) (&fMaskedIfs), rc); 1646 if (fMaskedIfs) 1647 RTPrintf("Masked Interfaces: 0x%08x\n", fMaskedIfs); 1648 RTPrintf("\n"); 1649 } 1639 1650 1640 1651 rc = Enum->HasMore (&fMore); … … 6576 6587 return errorSyntax(USAGE_USBFILTER_ADD, "Not enough parameters"); 6577 6588 } 6578 else 6579 { 6580 return errorSyntax(USAGE_USBFILTER_MODIFY, "Not enough parameters"); 6581 } 6589 return errorSyntax(USAGE_USBFILTER_MODIFY, "Not enough parameters"); 6582 6590 } 6583 6591 … … 6698 6706 cmd.mFilter.mSerialNumber = argv [i]; 6699 6707 } 6708 else if (strcmp(argv [i], "-maskedinterfaces") == 0) 6709 { 6710 if (argc <= i + 1) 6711 { 6712 return errorArgument("Missing argument to '%s'", argv[i]); 6713 } 6714 i++; 6715 uint32_t u32; 6716 rc = RTStrToUInt32Full(argv[i], 0, &u32); 6717 if (RT_FAILURE(rc)) 6718 { 6719 return errorArgument("Failed to convert the -maskinterfaces value '%s' to a number, rc=%Rrc", argv[i], rc); 6720 } 6721 cmd.mFilter.mMaskedInterfaces = u32; 6722 } 6700 6723 else if (strcmp(argv [i], "-action") == 0) 6701 6724 { … … 6820 6843 if (!f.mSerialNumber.isNull()) 6821 6844 CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber.setNullIfEmpty())); 6845 if (!f.mMaskedInterfaces.isNull()) 6846 CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces)); 6822 6847 6823 6848 if (f.mAction != USBDeviceFilterAction_InvalidUSBDeviceFilterAction) … … 6845 6870 if (!f.mSerialNumber.isNull()) 6846 6871 CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber.setNullIfEmpty())); 6872 if (!f.mMaskedInterfaces.isNull()) 6873 CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces)); 6847 6874 6848 6875 CHECK_ERROR_BREAK (ctl, InsertDeviceFilter (cmd.mIndex, flt)); … … 6873 6900 if (!f.mSerialNumber.isNull()) 6874 6901 CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber.setNullIfEmpty())); 6902 if (!f.mMaskedInterfaces.isNull()) 6903 CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces)); 6875 6904 6876 6905 if (f.mAction != USBDeviceFilterAction_InvalidUSBDeviceFilterAction) … … 6901 6930 if (!f.mSerialNumber.isNull()) 6902 6931 CHECK_ERROR_BREAK (flt, COMSETTER(SerialNumber) (f.mSerialNumber.setNullIfEmpty())); 6932 if (!f.mMaskedInterfaces.isNull()) 6933 CHECK_ERROR_BREAK (flt, COMSETTER(MaskedInterfaces) (f.mMaskedInterfaces)); 6903 6934 } 6904 6935 break; -
trunk/src/VBox/Main/ConsoleImpl.cpp
r5580 r5713 3365 3365 * @param aDevice 3366 3366 * The device in question. 3367 * @param aMaskedIfs 3368 * The interfaces to hide from the guest. 3367 3369 * 3368 3370 * @note Locks this object for writing. 3369 3371 */ 3370 HRESULT Console::onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError )3372 HRESULT Console::onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs) 3371 3373 { 3372 3374 LogFlowThisFunc (("aDevice=%p aError=%p\n", aDevice, aError)); … … 3419 3421 } 3420 3422 3421 HRESULT rc = attachUSBDevice (aDevice );3423 HRESULT rc = attachUSBDevice (aDevice, aMaskedIfs); 3422 3424 #endif /* PDMUsb */ 3423 3425 … … 4709 4711 AssertReturn (aHostDevice && aConfig, E_FAIL); 4710 4712 #else /* PDMUsb */ 4711 HRESULT Console::attachUSBDevice (IUSBDevice *aHostDevice )4713 HRESULT Console::attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs) 4712 4714 { 4713 4715 AssertReturn (aHostDevice, E_FAIL); … … 4763 4765 PVMREQ pReq = NULL; 4764 4766 int vrc = VMR3ReqCall (mpVM, &pReq, RT_INDEFINITE_WAIT, 4765 (PFNRT) usbAttachCallback, 5, this, aHostDevice, Uuid.ptr(), fRemote, Address.raw());4767 (PFNRT) usbAttachCallback, 6, this, aHostDevice, Uuid.ptr(), fRemote, Address.raw(), aMaskedIfs); 4766 4768 #endif /* PDMUsb */ 4767 4769 if (VBOX_SUCCESS (vrc)) … … 4863 4865 //static 4864 4866 DECLCALLBACK(int) 4865 Console::usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, const char *aAddress )4867 Console::usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid, bool aRemote, const char *aAddress, ULONG aMaskedIfs) 4866 4868 { 4867 4869 LogFlowFuncEnter(); … … 4887 4889 4888 4890 int vrc = PDMR3USBCreateProxyDevice (that->mpVM, aUuid, aRemote, aAddress, pvRemoteBackend, 4889 portVersion == 1 ? VUSB_STDVER_11 : VUSB_STDVER_20 );4891 portVersion == 1 ? VUSB_STDVER_11 : VUSB_STDVER_20, aMaskedIfs); 4890 4892 if (VBOX_SUCCESS (vrc)) 4891 4893 { … … 5722 5724 /* Check if the device is ok for current USB filters. */ 5723 5725 BOOL fMatched = FALSE; 5724 5725 HRESULT hrc = mControl->RunUSBDeviceFilters(device, &fMatched); 5726 ULONG fMaskedIfs = 0; 5727 5728 HRESULT hrc = mControl->RunUSBDeviceFilters(device, &fMatched, &fMaskedIfs); 5726 5729 5727 5730 AssertComRC (hrc); 5728 5731 5729 LogFlowThisFunc (("USB filters return %d \n", fMatched));5732 LogFlowThisFunc (("USB filters return %d %#x\n", fMatched, fMaskedIfs)); 5730 5733 5731 5734 if (fMatched) 5732 5735 { 5733 hrc = onUSBDeviceAttach (device, NULL );5736 hrc = onUSBDeviceAttach (device, NULL, fMaskedIfs); 5734 5737 5735 5738 /// @todo (r=dmik) warning reporting subsystem -
trunk/src/VBox/Main/HostImpl.cpp
r5652 r5713 2193 2193 AssertReturn (aDevice->isStatePending() == false, false); 2194 2194 2195 bool hasMatch = aMachine->hasMatchingUSBFilter (aDevice); 2195 ULONG maskedIfs; 2196 bool hasMatch = aMachine->hasMatchingUSBFilter (aDevice, &maskedIfs); 2196 2197 2197 2198 if (hasMatch) 2198 2199 { 2199 2200 /* try to capture the device */ 2200 return aDevice->requestCapture (aMachine );2201 return aDevice->requestCapture (aMachine, maskedIfs); 2201 2202 } 2202 2203 -
trunk/src/VBox/Main/HostUSBDeviceImpl.cpp
r5528 r5713 379 379 * Captured), then the machine is informed before this method returns. 380 380 * 381 * @param aMachine Machine that will capture this device on success. 382 * @return @c false if the device could be immediately captured 383 * but the VM process refused to grab it; 384 * @c true otherwise. 381 * @param aMachine Machine that will capture this device on success. 382 * @param aMaskedIfs The interfaces to hide from the guest. 383 * @return @c false if the device could be immediately captured 384 * but the VM process refused to grab it; 385 * @c true otherwise. 385 386 * 386 387 * @note Must be called from under the object write lock. … … 388 389 * @note May lock the given machine object for reading. 389 390 */ 390 bool HostUSBDevice::requestCapture (SessionMachine *aMachine )391 bool HostUSBDevice::requestCapture (SessionMachine *aMachine, ULONG aMaskedIfs /* = 0*/) 391 392 { 392 393 LogFlowThisFunc (("\n")); … … 419 420 LogFlowThisFunc (("Calling machine->onUSBDeviceAttach()...\n")); 420 421 421 HRESULT rc = aMachine->onUSBDeviceAttach (d, NULL );422 HRESULT rc = aMachine->onUSBDeviceAttach (d, NULL, aMaskedIfs); 422 423 423 424 /* The VM process has a legal reason to fail (for example, incorrect … … 449 450 mPendingSince = RTTimeNanoTS(); 450 451 mMachine = aMachine; 452 mMaskedIfs = aMaskedIfs; 451 453 452 454 mUSBProxyService->captureDevice (this); … … 738 740 LogFlowThisFunc (("Calling machine->onUSBDeviceAttach()...\n")); 739 741 740 HRESULT rc = mMachine->onUSBDeviceAttach (d, error );742 HRESULT rc = mMachine->onUSBDeviceAttach (d, error, mMaskedIfs); 741 743 742 744 /* The VM process has a legal reason to fail (for example, incorrect -
trunk/src/VBox/Main/MachineImpl.cpp
r5627 r5713 2537 2537 } 2538 2538 2539 /** 2539 /** 2540 2540 * Saves the registry entry of this machine to the given configuration node. 2541 * 2541 * 2542 2542 * @param aEntryNode Node to save the registry entry to. 2543 2543 * … … 8514 8514 */ 8515 8515 STDMETHODIMP SessionMachine::RunUSBDeviceFilters (IUSBDevice *aUSBDevice, 8516 BOOL *aMatched) 8516 BOOL *aMatched, 8517 ULONG *aMaskedIfs) 8517 8518 { 8518 8519 LogFlowThisFunc (("\n")); … … 8526 8527 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 8527 8528 8528 *aMatched = mUSBController->hasMatchingFilter (aUSBDevice );8529 *aMatched = mUSBController->hasMatchingFilter (aUSBDevice, aMaskedIfs); 8529 8530 8530 8531 return S_OK; … … 9516 9517 } 9517 9518 9518 /** 9519 /** 9519 9520 * Returns @c true if this machine's USB controller reports it has a matching 9520 9521 * filter for the given USB device and @c false otherwise. … … 9522 9523 * @note Locks this object for reading. 9523 9524 */ 9524 bool SessionMachine::hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice )9525 bool SessionMachine::hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs) 9525 9526 { 9526 9527 AutoCaller autoCaller (this); … … 9532 9533 AutoReaderLock alock (this); 9533 9534 9534 return mUSBController->hasMatchingFilter (aDevice );9535 return mUSBController->hasMatchingFilter (aDevice, aMaskedIfs); 9535 9536 } 9536 9537 … … 9539 9540 */ 9540 9541 HRESULT SessionMachine::onUSBDeviceAttach (IUSBDevice *aDevice, 9541 IVirtualBoxErrorInfo *aError) 9542 IVirtualBoxErrorInfo *aError, 9543 ULONG aMaskedIfs) 9542 9544 { 9543 9545 LogFlowThisFunc (("\n")); … … 9560 9562 return E_FAIL; 9561 9563 9562 return directControl->OnUSBDeviceAttach (aDevice, aError );9564 return directControl->OnUSBDeviceAttach (aDevice, aError, aMaskedIfs); 9563 9565 } 9564 9566 -
trunk/src/VBox/Main/SessionImpl.cpp
r4071 r5713 606 606 607 607 STDMETHODIMP Session::OnUSBDeviceAttach (IUSBDevice *aDevice, 608 IVirtualBoxErrorInfo *aError) 609 { 610 LogFlowThisFunc (("\n")); 611 612 AutoCaller autoCaller (this); 613 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 614 615 AutoReaderLock alock (this); 616 AssertReturn (mState == SessionState_SessionOpen && 617 mType == SessionType_DirectSession, E_FAIL); 618 619 return mConsole->onUSBDeviceAttach (aDevice, aError); 608 IVirtualBoxErrorInfo *aError, 609 ULONG aMaskedIfs) 610 { 611 LogFlowThisFunc (("\n")); 612 613 AutoCaller autoCaller (this); 614 AssertComRCReturn (autoCaller.rc(), autoCaller.rc()); 615 616 AutoReaderLock alock (this); 617 AssertReturn (mState == SessionState_SessionOpen && 618 mType == SessionType_DirectSession, E_FAIL); 619 620 return mConsole->onUSBDeviceAttach (aDevice, aError, aMaskedIfs); 620 621 } 621 622 … … 994 995 #endif 995 996 996 #if defined(RT_OS_OS2) 997 #if defined(RT_OS_OS2) 997 998 /** VM IPC mutex holder thread */ 998 999 DECLCALLBACK(int) IPCMutexHolderThread (RTTHREAD Thread, void *pvUser) -
trunk/src/VBox/Main/USBControllerImpl.cpp
r5617 r5713 539 539 Bstr remote; 540 540 CFGLDRQueryBSTR (filter, "remote", remote.asOutParam()); 541 uint32_t maskedIfs; 542 if (RT_FAILURE(CFGLDRQueryUInt32 (filter, "maskedInterfaces", &maskedIfs))) 543 maskedIfs = 0; 541 544 542 545 ComObjPtr <USBDeviceFilter> filterObj; … … 545 548 name, active, vendorId, productId, revision, 546 549 manufacturer, product, serialNumber, 547 port, remote );550 port, remote, maskedIfs); 548 551 /* error info is set by init() when appropriate */ 549 552 if (SUCCEEDED (rc)) … … 657 660 CFGLDRSetBSTR (filter, "remote", data.mRemote.string()); 658 661 #endif /* VBOX_WITH_USBFILTER */ 662 663 if (data.mMaskedIfs) 664 CFGLDRSetUInt32 (filter, "maskedInterfaces", data.mMaskedIfs); 659 665 660 666 CFGLDRReleaseNode (filter); … … 1102 1108 * @note Locks this object for reading. 1103 1109 */ 1104 bool USBController::hasMatchingFilter ( ComObjPtr <HostUSBDevice> &aDevice)1110 bool USBController::hasMatchingFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs) 1105 1111 { 1106 1112 AutoCaller autoCaller (this); … … 1113 1119 return false; 1114 1120 1115 bool match = false;1116 1117 1121 /* apply self filters */ 1118 1122 for (DeviceFilterList::const_iterator it = mDeviceFilters->begin(); 1119 !match &&it != mDeviceFilters->end();1123 it != mDeviceFilters->end(); 1120 1124 ++ it) 1121 1125 { 1122 1126 AutoLock filterLock (*it); 1123 match = aDevice->isMatch ((*it)->data()); 1124 } 1125 1126 return match; 1127 if (aDevice->isMatch ((*it)->data())) 1128 { 1129 *aMaskedIfs = (*it)->data().mMaskedIfs; 1130 return true; 1131 } 1132 } 1133 1134 return false; 1127 1135 } 1128 1136 … … 1139 1147 * @note Locks this object for reading. 1140 1148 */ 1141 bool USBController::hasMatchingFilter (IUSBDevice *aUSBDevice )1149 bool USBController::hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs) 1142 1150 { 1143 1151 LogFlowThisFuncEnter(); … … 1265 1273 1266 1274 match = true; 1275 *aMaskedIfs = aData.mMaskedIfs; 1267 1276 break; 1268 1277 } -
trunk/src/VBox/Main/USBDeviceFilterImpl.cpp
r4071 r5713 174 174 INPTR BSTR aManufacturer, INPTR BSTR aProduct, 175 175 INPTR BSTR aSerialNumber, 176 INPTR BSTR aPort, INPTR BSTR aRemote) 176 INPTR BSTR aPort, INPTR BSTR aRemote, 177 ULONG aMaskedIfs) 177 178 { 178 179 LogFlowThisFunc (("aParent=%p\n", aParent)); … … 194 195 mData->mName = aName; 195 196 mData->mActive = aActive; 197 mData->mMaskedIfs = 0; 196 198 197 199 /* initialize all filters to any match using null string */ … … 233 235 rc = COMSETTER(Remote) (aRemote); 234 236 CheckComRCBreakRC (rc); 237 rc = COMSETTER(MaskedInterfaces) (aMaskedIfs); 238 CheckComRCBreakRC (rc); 235 239 } 236 240 while (0); … … 269 273 mData->mName = aName; 270 274 mData->mActive = FALSE; 275 mData->mMaskedIfs = 0; 271 276 272 277 /* initialize all filters to any match using null string */ … … 959 964 mData.backup(); 960 965 mData->mRemote = flt; 966 967 /* leave the lock before informing callbacks */ 968 alock.unlock(); 969 970 return mParent->onDeviceFilterChange (this); 971 } 972 973 return S_OK; 974 } 975 976 STDMETHODIMP USBDeviceFilter::COMGETTER(MaskedInterfaces) (ULONG *aMaskedIfs) 977 { 978 if (!aMaskedIfs) 979 return E_POINTER; 980 981 AutoCaller autoCaller (this); 982 CheckComRCReturnRC (autoCaller.rc()); 983 984 AutoReaderLock alock (this); 985 986 *aMaskedIfs = mData->mMaskedIfs; 987 988 return S_OK; 989 } 990 991 STDMETHODIMP USBDeviceFilter::COMSETTER(MaskedInterfaces) (ULONG aMaskedIfs) 992 { 993 AutoCaller autoCaller (this); 994 CheckComRCReturnRC (autoCaller.rc()); 995 996 /* the machine needs to be mutable */ 997 Machine::AutoMutableStateDependency adep (mParent->parent()); 998 CheckComRCReturnRC (adep.rc()); 999 1000 AutoLock alock (this); 1001 1002 if (mData->mMaskedIfs != aMaskedIfs) 1003 { 1004 mData.backup(); 1005 mData->mMaskedIfs = aMaskedIfs; 961 1006 962 1007 /* leave the lock before informing callbacks */ … … 1192 1237 #endif /* VBOX_WITH_USBFILTER */ 1193 1238 mData->mRemote = NULL; 1239 mData->mMaskedIfs = 0; 1194 1240 1195 1241 mInList = false; … … 1273 1319 #endif /* VBOX_WITH_USBFILTER */ 1274 1320 mData->mRemote = NULL; 1321 mData->mMaskedIfs = 0; 1275 1322 1276 1323 /* Confirm successful initialization */ … … 1776 1823 tr ("The remote state filter is not supported by " 1777 1824 "IHostUSBDeviceFilter objects")); 1825 } 1826 1827 STDMETHODIMP HostUSBDeviceFilter::COMGETTER(MaskedInterfaces) (ULONG *aMaskedIfs) 1828 { 1829 if (!aMaskedIfs) 1830 return E_POINTER; 1831 1832 AutoCaller autoCaller (this); 1833 CheckComRCReturnRC (autoCaller.rc()); 1834 1835 AutoReaderLock alock (this); 1836 1837 *aMaskedIfs = mData->mMaskedIfs; 1838 1839 return S_OK; 1840 } 1841 1842 STDMETHODIMP HostUSBDeviceFilter::COMSETTER(MaskedInterfaces) (INPTR ULONG aMaskedIfs) 1843 { 1844 return setError (E_NOTIMPL, 1845 tr ("The masked interfaces property is not applicable to IHostUSBDeviceFilter objects")); 1778 1846 } 1779 1847 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r5641 r5713 1902 1902 <interface 1903 1903 name="IInternalMachineControl" extends="$unknown" 1904 uuid=" f33740bf-53b2-4519-b950-104260c6a189"1904 uuid="1063893c-4c38-4304-aee9-73e072c181cc" 1905 1905 internal="yes" 1906 1906 wsmap="suppress" … … 1934 1934 </desc> 1935 1935 <param name="device" type="IUSBDevice" dir="in"/> 1936 <param name="matched" type="boolean" dir="return"/> 1936 <param name="matched" type="boolean" dir="out"/> 1937 <param name="maskedInterfaces" type="unsigned long" dir="out"/> 1937 1938 </method> 1938 1939 … … 7981 7982 <enumerator 7982 7983 name="IUSBDeviceFilterEnumerator" type="IUSBDeviceFilter" 7983 uuid=" 8d066d8b-3576-4a22-a387-847840937453"7984 uuid="d5109c61-93e7-4726-926b-0dee1020da56" 7984 7985 /> 7985 7986 … … 8140 8141 i.e. it is ignored by IHostUSBDeviceFilter objects. 8141 8142 </note> 8143 </desc> 8144 </attribute> 8145 8146 <attribute name="maskedInterfaces" type="unsigned long"> 8147 <desc> 8148 This is an advanced option for hiding one or more USB interfaces 8149 from the guest. The value is a bitmask where the bits that are set 8150 means the corresponding USB interface should be hidden, masked off 8151 if you like. 8152 This feature only works on Linux hosts. 8142 8153 </desc> 8143 8154 </attribute> … … 8583 8594 <interface 8584 8595 name="IInternalSessionControl" extends="$unknown" 8585 uuid=" e25a28b0-a58a-4582-b7c8-40abaa1f5d5b"8596 uuid="37838967-2430-4bb1-8acc-1b5b2c383d44" 8586 8597 internal="yes" 8587 8598 wsmap="suppress" … … 8709 8720 <param name="device" type="IUSBDevice" dir="in"/> 8710 8721 <param name="error" type="IVirtualBoxErrorInfo" dir="in"/> 8722 <param name="maskedInterfaces" type="unsigned long" dir="in"/> 8711 8723 </method> 8712 8724 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r5520 r5713 174 174 HRESULT onUSBControllerChange(); 175 175 HRESULT onSharedFolderChange (BOOL aGlobal); 176 HRESULT onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError );176 HRESULT onUSBDeviceAttach (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs); 177 177 HRESULT onUSBDeviceDetach (INPTR GUIDPARAM aId, IVirtualBoxErrorInfo *aError); 178 178 … … 416 416 PVUSBIRHCONFIG aConfig, PCRTUUID aUuid); 417 417 #else /* PDMUsb coding. */ 418 HRESULT attachUSBDevice (IUSBDevice *aHostDevice );418 HRESULT attachUSBDevice (IUSBDevice *aHostDevice, ULONG aMaskedIfs); 419 419 HRESULT detachUSBDevice (USBDeviceList::iterator &aIt); 420 420 421 421 static DECLCALLBACK(int) 422 422 usbAttachCallback (Console *that, IUSBDevice *aHostDevice, PCRTUUID aUuid, 423 bool aRemote, const char *aAddress );423 bool aRemote, const char *aAddress, ULONG aMaskedIfs); 424 424 static DECLCALLBACK(int) 425 425 usbDetachCallback (Console *that, USBDeviceList::iterator *aIt, PCRTUUID aUuid); -
trunk/src/VBox/Main/include/HostUSBDeviceImpl.h
r5528 r5713 129 129 Utf8Str name(); 130 130 131 bool requestCapture (SessionMachine *aMachine );131 bool requestCapture (SessionMachine *aMachine, ULONG aMaskedIfs = 0); 132 132 void requestRelease(); 133 133 void requestHold(); … … 173 173 * Only used for host devices. */ 174 174 PUSBDEVICE mUsb; 175 176 /** The interface mask to be use in the pending capture. */ 177 ULONG mMaskedIfs; 175 178 176 179 friend class USBProxyService; -
trunk/src/VBox/Main/include/MachineImpl.h
r5642 r5713 358 358 }; 359 359 360 /** 360 /** 361 361 * Shortcut to AutoStateDependency <AnyStateDep>. 362 362 * See AutoStateDependency to get the usage pattern. … … 371 371 typedef AutoStateDependency <AnyStateDep> AutoAnyStateDependency; 372 372 373 /** 373 /** 374 374 * Shortcut to AutoStateDependency <MutableStateDep>. 375 375 * See AutoStateDependency to get the usage pattern. … … 388 388 typedef AutoStateDependency <MutableStateDep> AutoMutableStateDependency; 389 389 390 /** 390 /** 391 391 * Shortcut to AutoStateDependency <MutableOrSavedStateDep>. 392 392 * See AutoStateDependency to get the usage pattern. … … 511 511 ComObjPtr <SessionMachine> sessionMachine(); 512 512 513 /** 513 /** 514 514 * Returns the VirtualBox object this machine belongs to. 515 515 * … … 520 520 const ComObjPtr <VirtualBox, ComWeakRef> &virtualBox() const { return mParent; } 521 521 522 /** 522 /** 523 523 * Returns this machine's name. 524 524 * … … 529 529 const Guid &uuid() const { return mData->mUuid; } 530 530 531 /** 531 /** 532 532 * Returns this machine's full settings file path. 533 533 * … … 538 538 const Bstr &settingsFileFull() const { return mData->mConfigFileFull; } 539 539 540 /** 540 /** 541 541 * Returns this machine's name. 542 542 * … … 771 771 STDMETHOD(UpdateState)(MachineState_T machineState); 772 772 STDMETHOD(GetIPCId)(BSTR *id); 773 STDMETHOD(RunUSBDeviceFilters) (IUSBDevice *aUSBDevice, BOOL *aMatched );773 STDMETHOD(RunUSBDeviceFilters) (IUSBDevice *aUSBDevice, BOOL *aMatched, ULONG *aMaskedIfs); 774 774 STDMETHOD(CaptureUSBDevice) (INPTR GUIDPARAM aId); 775 775 STDMETHOD(DetachUSBDevice) (INPTR GUIDPARAM aId, BOOL aDone); … … 796 796 bool checkForDeath(); 797 797 798 #if defined (RT_OS_WINDOWS) 798 #if defined (RT_OS_WINDOWS) 799 799 HANDLE ipcSem() { return mIPCSem; } 800 800 #elif defined (RT_OS_OS2) … … 810 810 HRESULT onUSBControllerChange(); 811 811 HRESULT onUSBDeviceAttach (IUSBDevice *aDevice, 812 IVirtualBoxErrorInfo *aError); 812 IVirtualBoxErrorInfo *aError, 813 ULONG aMaskedIfs); 813 814 HRESULT onUSBDeviceDetach (INPTR GUIDPARAM aId, 814 815 IVirtualBoxErrorInfo *aError); 815 816 HRESULT onSharedFolderChange(); 816 817 817 bool hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice );818 bool hasMatchingUSBFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs); 818 819 819 820 private: -
trunk/src/VBox/Main/include/SessionImpl.h
r4071 r5713 99 99 STDMETHOD(OnUSBControllerChange)(); 100 100 STDMETHOD(OnSharedFolderChange) (BOOL aGlobal); 101 STDMETHOD(OnUSBDeviceAttach) (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError );101 STDMETHOD(OnUSBDeviceAttach) (IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs); 102 102 STDMETHOD(OnUSBDeviceDetach) (INPTR GUIDPARAM aId, IVirtualBoxErrorInfo *aError); 103 103 STDMETHOD(OnShowWindow) (BOOL aCheck, BOOL *aCanShow, ULONG64 *aWinId); -
trunk/src/VBox/Main/include/USBControllerImpl.h
r5613 r5713 116 116 BOOL aActiveChanged = FALSE); 117 117 118 bool hasMatchingFilter ( ComObjPtr <HostUSBDevice> &aDevice);119 bool hasMatchingFilter (IUSBDevice *aUSBDevice );118 bool hasMatchingFilter (const ComObjPtr <HostUSBDevice> &aDevice, ULONG *aMaskedIfs); 119 bool hasMatchingFilter (IUSBDevice *aUSBDevice, ULONG *aMaskedIfs); 120 120 121 121 HRESULT notifyProxy (bool aInsertFilters); -
trunk/src/VBox/Main/include/USBDeviceFilterImpl.h
r4071 r5713 69 69 typedef matching::Matchable <matching::ParsedBoolFilter> BOOLFilter; 70 70 71 Data() : mActive (FALSE), m Id (NULL) {}71 Data() : mActive (FALSE), mMaskedIfs (0), mId (NULL) {} 72 72 #ifdef VBOX_WITH_USBFILTER 73 73 Data (const Data &aThat) : mName (aThat.mName), mActive (aThat.mActive), 74 mRemote (aThat.mRemote), m Id (NULL)74 mRemote (aThat.mRemote), mMaskedIfs (aThat.mMaskedIfs) , mId (aThat.mId) 75 75 { 76 76 USBFilterClone (&mUSBFilter, &aThat.mUSBFilter); … … 91 91 mSerialNumber.string() == that. mSerialNumber.string() && 92 92 mPort.string() == that. mPort.string() && 93 mRemote.string() == that. mRemote.string()); 93 mRemote.string() == that. mRemote.string() && 94 mMaskedIfs == that. mMaskedIfs); 94 95 #else /* VBOX_WITH_USBFILTER */ 95 96 return this == &that 96 97 || ( mName == that.mName 97 98 && mActive == that.mActive 99 && mMaskedIfs == that.mMaskedIfs 98 100 && USBFilterIsIdentical (&mUSBFilter, &that.mUSBFilter)); 99 101 #endif /* VBOX_WITH_USBFILTER */ … … 116 118 BOOLFilter mRemote; 117 119 120 /** Config value. */ 121 ULONG mMaskedIfs; 122 118 123 /** Arbitrary ID field (not used by the class itself) */ 119 124 void *mId; … … 145 150 INPTR BSTR aManufacturer, INPTR BSTR aProduct, 146 151 INPTR BSTR aSerialNumber, 147 INPTR BSTR aPort, INPTR BSTR aRemote); 152 INPTR BSTR aPort, INPTR BSTR aRemote, 153 ULONG aMaskedIfs); 148 154 HRESULT init (USBController *aParent, INPTR BSTR aName); 149 155 HRESULT init (USBController *aParent, USBDeviceFilter *aThat, … … 173 179 STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote); 174 180 STDMETHOD(COMSETTER(Remote)) (INPTR BSTR aRemote); 181 STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs); 182 STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs); 175 183 176 184 // public methods only for internal purposes … … 290 298 STDMETHOD(COMGETTER(Remote)) (BSTR *aRemote); 291 299 STDMETHOD(COMSETTER(Remote)) (INPTR BSTR aRemote); 300 STDMETHOD(COMGETTER(MaskedInterfaces)) (ULONG *aMaskedIfs); 301 STDMETHOD(COMSETTER(MaskedInterfaces)) (ULONG aMaskedIfs); 292 302 293 303 // IHostUSBDeviceFilter properties -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r5613 r5713 8 8 9 9 Copyright (C) 2004-2007 innotek GmbH 10 10 11 11 This file is part of VirtualBox Open Source Edition (OSE), as 12 12 available from http://www.virtualbox.org. This file is free software; … … 302 302 <xsd:attribute name="port" type="xsd:token"/> 303 303 <xsd:attribute name="remote" type="xsd:token"/> 304 <xsd:attribute name="maskedInterfaces" type="xsd:unsignedInt"/> 304 305 </xsd:complexType> 305 306
Note:
See TracChangeset
for help on using the changeset viewer.