Changeset 17684 in vbox for trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h
- Timestamp:
- Mar 11, 2009 12:15:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h
r15051 r17684 8 8 9 9 /* 10 * Copyright (C) 2006-200 8Sun Microsystems, Inc.10 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 11 11 * 12 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 27 27 28 28 #include "VirtualBoxBase.h" 29 #include "Collection.h"30 29 31 30 struct _VRDPUSBDEVICEDESC; … … 138 137 }; 139 138 140 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_BEGIN (ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice)141 142 STDMETHOD(FindById) (IN_GUID aId, IHostUSBDevice **aDevice)143 {144 Guid idToFind = aId;145 if (idToFind.isEmpty())146 return E_INVALIDARG;147 if (!aDevice)148 return E_POINTER;149 150 *aDevice = NULL;151 Vector::value_type found;152 Vector::iterator it = vec.begin();153 while (!found && it != vec.end())154 {155 Guid id;156 (*it)->COMGETTER(Id) (id.asOutParam());157 if (id == idToFind)158 found = *it;159 ++ it;160 }161 162 if (!found)163 return setError (E_INVALIDARG, RemoteUSBDeviceCollection::tr (164 "Could not find a USB device with UUID {%s}"),165 idToFind.toString().raw());166 167 return found.queryInterfaceTo (aDevice);168 }169 170 STDMETHOD(FindByAddress) (IN_BSTR aAddress, IHostUSBDevice **aDevice)171 {172 if (!aAddress)173 return E_INVALIDARG;174 if (!aDevice)175 return E_POINTER;176 177 *aDevice = NULL;178 Vector::value_type found;179 Vector::iterator it = vec.begin();180 while (!found && it != vec.end())181 {182 Bstr address;183 (*it)->COMGETTER(Address) (address.asOutParam());184 if (address == aAddress)185 found = *it;186 ++ it;187 }188 189 if (!found)190 return setError (E_INVALIDARG, RemoteUSBDeviceCollection::tr (191 "Could not find a USB device with address '%ls'"),192 aAddress);193 194 return found.queryInterfaceTo (aDevice);195 }196 197 COM_DECL_READONLY_ENUM_AND_COLLECTION_EX_END (ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice)198 199 200 139 #endif // ____H_REMOTEUSBDEVICEIMPL 201 140 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note:
See TracChangeset
for help on using the changeset viewer.