Changeset 17553 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Mar 9, 2009 9:34:22 AM (16 years ago)
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r17275 r17553 115 115 STDMETHOD(COMGETTER(Display)) (IDisplay **aDisplay); 116 116 STDMETHOD(COMGETTER(Debugger)) (IMachineDebugger **aDebugger); 117 STDMETHOD(COMGETTER(USBDevices)) ( IUSBDeviceCollection **aUSBDevices);117 STDMETHOD(COMGETTER(USBDevices)) (ComSafeArrayOut (IUSBDevice *, aUSBDevices)); 118 118 STDMETHOD(COMGETTER(RemoteUSBDevices)) (IHostUSBDeviceCollection **aRemoteUSBDevices); 119 119 STDMETHOD(COMGETTER(RemoteDisplayInfo)) (IRemoteDisplayInfo **aRemoteDisplayInfo); … … 139 139 STDMETHOD(AttachUSBDevice) (IN_GUID aId); 140 140 STDMETHOD(DetachUSBDevice) (IN_GUID aId, IUSBDevice **aDevice); 141 STDMETHOD(FindUSBDeviceByAddress) (IN_BSTR aAddress, IUSBDevice **aDevice); 142 STDMETHOD(FindUSBDeviceById) (IN_GUID aId, IUSBDevice **aDevice); 141 143 STDMETHOD(CreateSharedFolder) (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable); 142 144 STDMETHOD(RemoveSharedFolder) (IN_BSTR aName); -
trunk/src/VBox/Main/include/USBDeviceImpl.h
r15051 r17553 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 26 26 #include "VirtualBoxBase.h" 27 #include "Collection.h"28 27 #include "Logging.h" 29 28 … … 121 120 }; 122 121 123 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <OUSBDevice>, IUSBDevice, OUSBDevice)124 125 STDMETHOD(FindById) (IN_GUID aId, IUSBDevice **aDevice)126 {127 Guid idToFind = aId;128 if (idToFind.isEmpty())129 return E_INVALIDARG;130 if (!aDevice)131 return E_POINTER;132 133 *aDevice = NULL;134 Vector::value_type found;135 Vector::iterator it = vec.begin();136 while (!found && it != vec.end())137 {138 Guid id;139 (*it)->COMGETTER(Id) (id.asOutParam());140 if (id == idToFind)141 found = *it;142 ++ it;143 }144 145 if (!found)146 {147 return setErrorNoLog (E_INVALIDARG, OUSBDeviceCollection::tr (148 "Could not find a USB device with UUID {%s}"),149 idToFind.toString().raw());150 }151 152 return found.queryInterfaceTo (aDevice);153 }154 155 STDMETHOD(FindByAddress) (IN_BSTR aAddress, IUSBDevice **aDevice)156 {157 if (!aAddress)158 return E_INVALIDARG;159 if (!aDevice)160 return E_POINTER;161 162 *aDevice = NULL;163 Vector::value_type found;164 Vector::iterator it = vec.begin();165 while (!found && it != vec.end())166 {167 Bstr address;168 (*it)->COMGETTER(Address) (address.asOutParam());169 if (address == aAddress)170 found = *it;171 ++ it;172 }173 174 if (!found)175 return setErrorNoLog (E_INVALIDARG, OUSBDeviceCollection::tr (176 "Could not find a USB device with address '%ls'"),177 aAddress);178 179 return found.queryInterfaceTo (aDevice);180 }181 182 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <OUSBDevice>, IUSBDevice, OUSBDevice)183 184 122 #endif // ____H_USBDEVICEIMPL 185 123 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.